Track Page Views with Google Analytics and Optimize
A guide to adding Google Analytics and Optimize trackers to your pages.
Google Analytics is supported out of the box for tracking public page views.
Obtaining your tracking ID
If you haven't done so already, head over to your Google Analytics dashboard and create a new property for your website. Once created, you will obtain a tracking ID, which is either a Google Analytics 4 property, or for legacy configurations, a Universal Analytics property.
Adding the tracking ID to your project
Head over to the
motif.json configuration file (open search using ⌘P and type
If you are using Google Analytics 4 properties, add an entry named
G-XXXXXXXX with your tracking ID:
If you are using Universal Analytics properties, add an entry named
UA-XXXXXXXX with your tracking ID:
Similarly to Analytics, Google Optimize works out-of-the-box. Head over to your Google Optimize dashboard and obtain a tracking code. In your
motif.json configuration file, add the Optimize script to the head section, as follows:
OPT-XXX with your tracking id. Google Optimize is now enabled across all the public pages of your project.
Copyright © 2022 Motif Land Inc. All rights reserved. This website is built with Motif.