Google Analytics

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
Google Analytics
  • Choose the Library tab.
Google Analytics
  • In the search box on the top search "Analytics API", then click on "Google Analytics API".
Google Analytics
  • Once you're on the Google Analytics API, click the "Enable" button
Google Analytics
  • 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.

Google Analytics

  • Once you're on the "Create OAuth client ID" page, click the Configure Consent Screen button
Google Analytics
  • On the OAuth Consent Screen, choose "External", then click the Create button

Google Analytics

  • 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)
Google Analytics
  • Under App Domain, enter the following:
    • Application home page
    • Application Privacy Policy link
    • Application Terms of Service link
Google Analytics
  • Under Authorized Domains, enter the following:
Google Analytics
  • You will now be taken to the Edit App Registration page > Scopes
    • Click the Add or Remove Scopes button
Google Analytics
  • 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
Google Analytics
  • Upon doing this, the window should close, and the Google Analytics API should now be added under "Your non-sensitive scopes"

Google Analytics

  • 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

Google Analytics

  • 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

Google Analytics

  • 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

Google Analytics

Google Analytics

  • 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

Google Analytics

  • 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

Google Analytics

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

Google Analytics

  • 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

Google Analytics

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

Google Analytics

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


Google Analytics

    • Go to the Library tab, search Analytics API keyword


Google Analytics

    • Go to details and click ENABLE button


Google Analytics

    • Go to the Credentials tab, click Create credentials and choose OAuth Client ID


Google Analytics

    • Click on Configure Consent Screen button (if needed), provide the Product name and some optional information


Google Analytics

  • Select the Web Application option


Google Analytics

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.


Google Analytics

    • 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.


Google Analytics

    • Accept the permissions asked by Google
  • Google Analytics
    • Step 2 on the left side panel. Click the Exchange Authorization code for tokens button
    • Copy the Refresh token generated


Google Analytics

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


Google 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

Google Analytics

  • On Audience Overview, click the "Share" button
  • A popup setup scheduled email will be shown

Google Analytics

  • Add emails that will be received, choose Frequency, add content for email
  • Click "Send" to save
  • Go to Scheduled emails to check that exits

Google Analytics

How to extend the time of scheduled emails

Email reports are configured for some time. This may need to be extended as time progresses.

  • On admin page, Select "Scheduled emails"Google Analytics
  • Select the email that you want to extend the time Google Analytics
  • Click "Extend" Google Analytics
  • The expiration date will be changed. Click "Save" Google Analytics
  • The scheduled email will be updated.Google Analytics

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.


Google Analytics

  • Go to the tracking code window


Google Analytics

  • Copy the tracking code


Google Analytics

  • Go to the website and access admin management, in the left menu select Settings > Site Settings then search Google Analytic Configuration key


Google Analytics

  • Click on the Edit icon then in the edit site settings page, paste the Google Analytics tracking code to the Tracking Script field.


Google Analytics