Google Tag Manager Installation
Most commonly, GTM is used by MetaLocator customers to invoke Google Analytics tags. In this scenario, Google Tag Manager script is added to MetaLocator in two steps, since the Google Tag Manager script is provided in two parts as shown below:
β
Paste the first segment into Advanced > Custom Head Tag
Paste the second segment into Advanced Custom Opening Body Tag
β
Capturing MetaLocator Events with Google Tag Manager
Google Tag Manager allows for fine control and authority as to what is pushed to Google Analytics by way of the various events and triggers configured in GA4. However, MetaLocator can also push events to the Google Tag Manager data layer. The data layer events can then be used to create variables and triggers for further customization. To enable data layer events, enable the Push Events to Data Layer option as shown below:
With the above setting enabled, the MetaLocator Analytics Events will be pushed onto the Data Layer along with the Event Context variables, prefaced by "ml_". The Event Context is the data that tells the analytics system the context in which the analytics event occurred.
For example, the OpenMarkerWindow event is pushed as shown below, and the context includes the Location ID and Item ID associated with the OpenMarkerWindow event.
Tags can then be triggered in response to Data Layer Events and those tags can leverage the Context Variables to push data into Google Analytics or 3rd party analytics platforms such as Adobe Experience Manager, Segment, Amplitude or Mixpanel.
Basic Setup with Cross Domain Support
In a typical setup, the Google Analytics installed above is also the Google Analytics used for tracking analytics events on the parent, or "host" Web site where MetaLocator is installed. Without cross domain support, a new Visitor would be generated when the user viewed the page with MetaLocator installed. This can artificially increase the number of Visitors since the visit to the page inside the MetaLocator interface will appear as a brand new visitor to Google.
Enabling Cross Domain support causes MetaLocator to find and pass a Google Analytics Client ID to from the host page to the MetaLocator IFRAME. This ensures that the Google Analytics events triggered by MetaLocator are associated with the same Google Analytics session as the one generated when the user first visited the host website.
To enable Cross Domain support, perform the following setups
Ensure the Google Tag Managers Installation code is installed on your host page.
Ensure the Google Analytics ID is provided in the Google Analytics ID setting under Analytics Settings as shown below.
Enable the "Cross Domain tracking via Google Tag Manager Support" as shown below:
3. Ensure you add the domain of the host page (E.g. yourdomain.com) to the referral exclusion list according to these instructions.