Register and setup the Analytics module

Register the Analytics module

Before you setup the Analytics module, you must register it in Google Analytics. You must register when you are setting up Analytics for the first time.

Perform the following: 

Enable Google Analytics as a trusted location for Sitefinity CMS.

  1. In Sitefinity CMS backend, navigate to Administration » Settings » Advanced » WebSecurity » RefererValidation.
  2. In the Trusted locations input field, enter and click Save changes.

Enable Google Analytics API and get the required data to integrate it into Sitefinity CMS.

  1. Navigate to Google Analytics and log in to your Google Analytics account.
  2. Navigate to Google Cloud Platform.
  3. In the toolbar, click Select a project.
    The Select a project window appears.
  4. Click NEW PROJECT.
    The New Project page appears.
  5. Choose a name for the project and click Create.
  6. In the toolbar, click on the Notification icon and then click on your newly created project.
  7. In the menu on the lift, click APIs & Services » Library.
  8. Under Other, select Google Analytics API.
  9. In the top part of the screen, click ENABLE.
  10. In the upper-right corner, click CREATE CREDENTIALS.
  11. In the Which API are you using dropdown, select Google Analytics API.
  12. Select User data.
  13. Click Next.
  14. Under OAuth Consent Screen, fill in the required fields, such as App name, User support email, and Developer contact information. Click SAVE AND CONTINUE.
    For more information, see Google documentation about Authentication overview.
  15. Under Scopes, click SAVE AND CONTINUE.
  16. Under OAuth Client ID select Web application.
  17. Under Authorized JavaScript origins, enter http://<your website>
  18. Under Authorized redirect URIs, enter http://<your website>/Sitefinity/marketing/Analytics
  19. Click Create.
  20. Copy and save in a secure place the following information under Download your credentials:
    1. The Client ID
    2. To obtain the client secrets, click Download, open the saved JSON file, and copy the value of the client_secret key.
  21. Click Done.

RESULT: You have registered the Analytics module and you can continue to setup the Analytics module in Sitefinity CMS backend.

Set up the Analytics module

PREREQUISITES: Before you setup the Analytics module, you must have added the Google Analytics script on at least one page, and the module must have already collected some data.

When you open the Analytics module for the first time, you need to configure it to show data for the site you want.

To setup Analytics, perform the following:

  1. Login to the Sitefinity CMS backend and navigate to Marketing » Analytics.
    If you have not used the Analytics module before, the Configure Analytics link appears.
  2. Click Configure Analytics.
  3. Paste the Client ID and Client Secret that you have copied in procedure Register the Analytics module » Step 20.

    NOTE: For specific Client ID and Client Secret, Sitefinity CMS stores only the latest generated refresh token. The reason is Google OAuth 2.0 limitation of 50 refresh tokens per user account. For more information, see the Google documentation about OAuth 2.0 token expiration.

  4. Click Login to Google.
  5. Allow the created project to view and manage your Google Analytics data.
  6. The Select Google Analytics account page opens.
  7. In Available accounts, select the view that you have created to track this website.

    NOTE: If you have not set the tracking code, provided by Google Analytics on any page of your website or the page where you have set it has not been requested, Sitefinity CMS cannot find account and your domain in the list of Tracked domains.

  8. In Tracked domains, select the domain of your website.
    If you do not see the domain in the list, you can enter it manually.
  9. Click Save Settings.
    The Google Analytics tracking code appears.
    RECOMMENDATION: We recommend you use this code instead of the existing Google Analytics tracking script, because it enables tracking of site visitors consent on your sites. For more information, see Tracking consent.
  10. Click Go to Analytics.

RESULT: You can see website analytics data in the Analytics module.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?