Use the below process to track website traffic to exhibitors / products / sessions / speakers within Google Tag Manager.

Enable History Variable

  1. On the Workspace Overview screen, select Variables
  2. Click Configure for the Built-In Variables
    Configure History Variables v2
  3. Scroll to History and check
  4. New History Fragment
  5. History Source
  6. Close the window

Get Path with Fragment

Custom JavaScript Variable Configuration

  1. On the same Variables screen
  2. Click New for the User-Defined Variables
  3. Name the variable ‘Path with Fragment’
  4. Choose Custom JavaScript as the variable type
  5. Copy and Paste the below code:
     
     
    function() { 
    return {{Event}} === 'gtm.historyChange' && {{New History Fragment}} ? {{Page Path}} + '#' + {{New History Fragment}} : undefined; 
    } 
     
    
    Click Save

Update the ‘Google Analytics settings’ Variable

History Trigger Configuration

  1. On the same Variables screen
  2. Click on the 'Google Analytics settings' in User-Defined Variables
  3. Click on More Settings and then Fields to Set
  4. Enter page for the Field Name
  5. Enter {{Get Path with Fragment}} for the Value
  6. Click Save

History Change Trigger

History Trigger Configuration

  1. Select Triggers
  2. Name the trigger ‘Event - History Fragment Change’
  3. Select Trigger Configuration
  4. Choose History Change
  5. Change the fire to Some History Changes and configure to History contains replaceState
  6. Click Save

Link the Triggers to the Tag

Google Analytics Page View

  1. Select Tags
  2. Open the ‘Google Analytics - Page View’ tag
  3. Add the ‘Event - History Fragment Change’ to Triggering
  4. Click Save