Google Analytics Overview
Google Analytics allows you to track your visitors counts, time on site and pages viewed along with a wide range of other traffic statistics. WebEd fully supports Google Analytics and provides easy-to-use tools for integrating Google Analytics
Adding Analytics to your Site Dashboard
Requirement: You will need a Google Account that owns the property (the website)
Full details are below, but this step-by-step guide will outline the process. This is an optional step if only the client requests to display the Google Analytics overview on the Dashboard.
Register for the Google OAuth Client
- Browse the URL https://console.developers.google.com
- Sign in with your Google account
- Click on the Create Project button to create a new project
- In the pop-up window which appears, enter your project name as desired and click on Create button. Let this process run, it may take a few seconds
- After the project is created successfully, the page reloads with some options on the left menu: Home, Marketplace, Billing, APIs & Services, Support, etc.
- Click on the APIs & Services
- Choose the Library tab.
- In the search box on the top search "Analytics API", then click on "Google Analytics API".
- Once you're on the Google Analytics API, click the "Enable" button
- Now on the left menu, click the Credentials tab, then click Create Credentials on top, and choose OAuth Client ID.
- Follow the details for the Credential Type form
- OAuth Screen form details:
- Update selected Scopes, search for the "Google Analytics API" on the filter section and select all the scopes from the results
- If you are not on the Google Analytics API screen anymore, on the left menu, click the Credentials tab, then click Create Credentials on top, and choose OAuth Client ID.
- Once you're on the "Create OAuth client ID" page, click the Configure Consent Screen button
- On the OAuth Consent Screen, choose "External", then click the Create button
- You will now be taken to the Edit App Registration page > OAuth Consent Screen
- For the App Information, enter the following:
- App Name - enter a name, which can be company name + "WebEd"
- User Support Email - use the email address you created for the API (Gmail)
- Under App Domain, enter the following:
- Application home page
- Application Privacy Policy link
- Application Terms of Service link
- Under Authorized Domains, enter the following:
- Domain - add the domain of your site
- Developer Contact Information - enter and add support@interactivepartners.com.au
- Then click the Save and Continue button
- You will now be taken to the Edit App Registration page > Scopes
- Click the Add or Remove Scopes button
- A window "Update Selected Scopes" will pop up on the right
- Click through the table rows and look for "Google Analytics API" without a lock icon
- Once you find it, tick the box beside it, then click the Update button at the bottom of the window
- Upon doing this, the window should close, and the Google Analytics API should now be added under "Your non-sensitive scopes"
- Ignore "Your sensitive scopes" and " Your restricted scopes", and scroll to the bottom, click the Save and Continue button
- You will now be taken to the Edit App Registration page > Optional Info
- Ignore all fields here. Scroll to the bottom and click the Save and Continue button
- You will now be taken to the Edit App Registration page > Summary screen
- Check everything, then click the button "Back to Dashboard" at the bottom
- Now, go back to the Credentials page, click Create Credentials, choose OAuth Client ID
- You will now be taken to the Create OAuth client ID page
- Enter the following information:
- Application type - select Web application
- Name - enter the name of the site or any preferred
- Under Authorized JavaScript origins, add your website URL in the URIs field
- Under Authorized redirect URIs, enter "https://developers.google.com/oauthplayground"
- Click on the Create button. This will generate your Client ID and Client Secret
- Once you click the Create button, the page reloads and a window with your Client ID and Client Secret information appears
- Copy both Client ID and Client Secret and paste them into Notepad, you will need it in a minute
Add the OAuth details to your website
- Now browse the URL https://developers.google.com/oauthplayground/.
- On the right side of the window, click the Settings icon
- Tick the box for Use your own OAuth credentials
- Enter the copied Client ID and Client Secret in the corresponding fields, then click Close at the bottom
Step 1: Select & authorize APIs
- Search for "Google Analytics API v3" using the scroll. Click all the options under it, then click on the Authorize APIs button after the selection
- Accept all the permissions asked by Google
- If you get any Authorisation Errors, please make sure your Gmail account has been added to Test users
Step 2: Exchange Authorization code for tokens
- Now in Step 2 on the left side panel. Click "Exchange Authorization code for tokens"
- Click on Auto-refresh the token before it expires.
- Copy the Refresh token generated
Add to the Google Analytics Site Setting to your Website Admin Dashboard
- Enter the Client ID, Client Secret and Refresh Token in the Settings
- Click Save Settings.
- Your dashboard will load.
Register for the Google OAuth Client
- Register Google Oauth
- Go to https://console.developers.google.com,and sign in with the email used to get the tracking code in the above step.
- Create a new project or select an existing project
-
- Go to the Library tab, search Analytics API keyword
-
- Go to details and click ENABLE button
-
- Go to the Credentials tab, click Create credentials and choose OAuth Client ID
-
- Click on Configure Consent Screen button (if needed), provide the Product name and some optional information
- Select the Web Application option
Provide the Name, and enter your website URL into the Authorized JavaScript origins field, in the Authorized redirect, URIs enter "https://developers.google.com/oauthplayground" and click on Create button. This will generate your client ID and Client Secret
Copy and paste the Client ID and Client Secret into notepad, you will need it in a minute.
- Config the website
- Go to https://developers.google.com/oauthplayground/
- On the right side of the window click the settings icon and choose the Use your own OAuth credentials, enter the copied Client ID and Secret in the text box prompted. Click the Close link button.
-
- In Step 1 search for Google Analytics API v3 using the scroll. Select all the options under it. Click on Authorize APIs after selection. Make sure you have everything configured and OAuth credentials are filled out or else you will get a URI Mismatch error.
-
- Accept the permissions asked by Google
-
- Step 2 on the left side panel. Click the Exchange Authorization code for tokens button
- Copy the Refresh token generated
Add the oAuth details to your Website Admin Dashboard
- Enter the Client ID, Client Secret and Refresh Token in the Settings
- Click Save Settings.
- Your dashboard will load.
- You can select the property for different sites in your analytics
Setup Automated Google Analytics Reports
Outlines how to manage scheduled Google Analytics email reporting
What is a Google Analytics Reports
Provides a snapshot of your google analytics emailed to you as required.
How to set up scheduled emails
- Go to https://www.google.com/analytics/ and log in to google analytics
- Choose "Audience" >> Click "Overview"
- On Audience Overview, click the "Share" button
- A popup setup scheduled email will be shown
- Add emails that will be received, choose Frequency, add content for email
- Click "Send" to save
- Go to Scheduled emails to check that exits
How to extend the time of scheduled emails
Email reports are configured for some time. This may need to be extended as time progresses.
- Go to https://www.google.com/analytics/ and log in to google analytics
- Click "Admin"
- On admin page, Select "Scheduled emails"
- Select the email that you want to extend the time
- Click "Extend"
- The expiration date will be changed. Click "Save"
- The scheduled email will be updated.
Best Practices for Google Tag Manager and Google Analytics
Google Analytics - Managing your Analytics Account
Google Tag Manager Guide
Adding Analytics Tracking to your site
Get Your Analytics Code from Google
The first step is to get the tracking code for your site. You get this from your analytics account.
If you don't have an analytics account you can create one here - https://www.google.com/analytics.
- Login to https://analytics.google.com
- Go to the admin panel
- Go to the tracking code window
- Copy the tracking code
- Go to the website and access admin management, in the left menu select Settings > Site Settings then search Google Analytic Configuration key
- Click on the Edit icon then in the edit site settings page, paste the Google Analytics tracking code to the Tracking Script field.