This guide will walk you through the process of setting up an ObservePoint audit or journey to validate changes in Google Tag Manager (GTM) using our file substitution feature. Follow the steps carefully, as indicated by the red-highlighted areas in the images.
Step 1: Open Google Tag Manager and Access the Environment
Navigate to your Google Tag Manager account.
Under the Admin tab, select Environments.
Step 2: Create the Development Environment
On the Environments page, click New to create a new environment. We called our new environment “Dev” but you can name it whatever you like.
Step 3: Copy the GTM Share Link
After creating the new environment you’ll need to get the share link for it. You won’t actually use this link, but you’ll need the query strings from it.
Click Actions, then Share Link.
Copy the part of the share link that starts with gtm_auth (2nd screenshot). This is the part that puts GTM into “dev” mode.
Paste this into a note so you can use it in a later step.
Step 4: Create and Publish a GTM Version in the Dev Environment
Make a change to your GTM setup (tags, triggers, variables, etc)
Click Submit to create a new version of your GTM container.
Select the Dev (or whatever you called it) environment to publish to.
This will publish any changes you made to the “dev” environment without affecting the production version.
Step 5: Add a New File Substitution Rule in ObservePoint
Go to Configurations >> File Substitutions (1st screenshot).
Click to Create New.
In the File Substitution Config window, input the GTM container URLs. (2nd screenshot).
Give it a useful name, something like GTM Dev/Prod Swap for observepoint.com.
In the first URL field, enter the standard GTM script URL (i.e., the URL that you are replacing). It typically looks like this:
https://www.googletagmanager.com/gtm.js?id=GTM-A12B3C4In the second Substitute File URL, you’ll need to create this URL by adding the query strings from Step 3. It will look like this:
https://www.googletagmanager.com/gtm.js?id=GTM-K34G9P6>m_auth=ABC123456_DEF789>m_preview=env-120>m_cookies_win=x
Step 6: Add the File Substitution To an Audit or Journey
1. Open your ObservePoint audit and navigate to the **File Substitutions** configuration under the settings
Step 7: Run the Audit or Journey and Review Results in Reports