Track the attendees journey within Snapsight
It is possible via Google Tag Manager.
A. How to Set Up GTM in snapsight
1. During Project Creation
When creating a new project, you will have the option to insert GTM under Advanced Settings
Click on Advanced Settings
2. In Project Settings
To edit/add GTM after project creation, navigate to your project listing, find the desired project, and click the gear icon to access the settings and look for Advanced Settings.
B. Set Up Session Views Report
To establish a tracking reports of individual Snapsight sessions, the organiser can create a Custom JavaScript Variable to Capture Fragments
Step 1. Create a Custom JavaScript Variable to Capture Fragments
Since GTM's built-in {{Page Path}} and {{Page URL}} variables do not include fragments (#), we need a Custom JavaScript Variable.
Steps to Create the Variable:
- Open Google Tag Manager and go to Variables.
- Click New → Select Variable Type: Custom JavaScript.
- Name it: JS - URL Fragment.
Paste the following code:javascript
CopyEdit
function() {
return window.location.hash ? window.location.hash.substring(1) : "No Fragment";
} - Save the variable.
Step 2. Create a Trigger for URL Changes (Optional)
If you want to track when the fragment changes dynamically, set up a History Change Trigger.
Steps:
- Go to Triggers → New.
- Name it: History Change - Fragment Tracking.
- Choose Trigger Type: Page View.
- Configure as:
- Check: "Fragment Changes".
- (Optional) Add a condition: {{JS - URL Fragment}} does not equal "No Fragment".
- Save the trigger.
Step 3. Create a GA4 Event Tag to Send Data
Now, set up a GA4 Event Tag to send the captured fragment to GA4.
Steps:
- Go to Tags → New.
- Choose Google Analytics: GA4 Event.
- Name it: GA4 - URL Fragment Tracking.
- Select Configuration Tag (your GA4 tag).
- Set Event Name to: url_fragment_tracking.
- Under Event Parameters, add:
- Parameter Name: url_fragment
Value: {{JS - URL Fragment}}
- (Optional) Parameter Name: page_location
Value: {{Page URL}} - Triggering: Select the History Change - Fragment Tracking trigger (created in Step 2).
- Save and Publish.
Step 4. Verify in GA4 DebugView
- In GTM dashboard, Open the Preview
- Paste the Snapsight URL with a fragment in the Tag Assistant
- Open GA4 → Go to Admin → Click DebugView.
- Load your website and change the URL fragment (#example).
- Look for the "url_fragment_tracking" event.
- Ensure the url_fragment parameter appears with the correct value.