Google Analytics is a powerful web analytics tool which helps you gain meaningful insights of your website. Using Contentstack Marketplace you can easily install the Google Analytics app and use it within your stack.
This step-by-step guide explains how to install and configure the Google Analytics app in Contentstack Marketplace. With this, editors can see a graph of the page views for the URL corresponding to the current entry.
Note: When you install the Google Analytics app, by default, both the dashboard and sidebar widgets are configured.
Steps for Execution
- Fetch View ID and Service Account Details
- Install and Configure the Google Analytics App
- Use the Google Analytics Dashboard Widget
- Use the Google Analytics Sidebar Widget
Fetch View ID and Service Account Details
To install and configure Google Analytics app in Contentstack Marketplace, you need access to Google Analytics service account and View ID.
Refer to the Google Analytics documentation site to retrieve the JSON file of Google Service account and the View ID.
Install and Configure the Google Analytics App
Follow the steps below to install the application in Contentstack.
- Login to your Contentstack account.
- On the left-hand-side primary navigation, you will find a new icon for Marketplace (as shown below). Click on the icon to go to the Marketplace.
- Within the Marketplace, you will be able to see all the apps available, hover over the Google Analytics app and click on Install App.
- In the popup window, select the stack where you want the Google Analytics app to be installed and click on the Install button.
- Now on the Configuration screen, enter the following details:
- View ID: Enter the View ID retrieved in Step 1.
- Import Service Account details: Enter the Service Account details retrieved in Step 1.
Note: The project_id, client_email and private_key are mandatory fields in JSON file which cannot be edited.
- After adding the configuration details, click on the Save button.
Use the Google Analytics Dashboard Widget
- Select the Dashboard Widget icon to display your entire Google account analytics.
By default, it displays the data for 30 days.
- From the options provided, you can select the number of days for which data should be displayed.
Use the Google Analytics Sidebar Widget
- Create an entry in a content type that has Title and URL as fields.
- In the Title field, enter a suitable title for your entry.
- In the URL field, enter the URL of the page for which you want to take the Google Analytics data.
- Save the entry.
- Go to Widgets in the sidebar and select the Google Analytics app you configured.
This displays the Google Analytics data for the specific page.
- From the options provided, you can select the number of days for which data should be displayed for the specific page.