Open Forum

 View Only
  • 1.  Google Tag Manager (GTM) on Flex Sites

    Posted 4 days ago
    I've posted this in a couple of discussions but realized maybe it would be better as its own post. It took me hours of searching and testing to finally figure out how to add GTM to a Flex event and get it to fire correctly to load the container, fire off page views and a reg conversion event.

    To save everyone else time, here was my setup (you'll have to update with your container code):

    This one goes in a snippet with the type Initialization:
    /* initialization snippet */
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    })(window,document,'script','dataLayer','GTM-YOUR CONTAINER CODE HERE');
    /* end initialization snippet */

    This one goes in a snippet with the type All website and registration pages:
    /* pageview snippet */
    'event': 'cvent_page_view'
    /* end pageview snippet */

    This one goes in a snippet with the type Registration conversions:
    /* reg conversion snippet */
    'event': 'reg_complete'
    /* reg conversion snippet */

    Here is the the export of the GTM container that I created to handle pushing the pageviews and registration complete event to GTM. It works for both UA and G4. All you have to do is import and update the IDs with your values (or replace with your settings/config variables). Hopefully no one else will have to spend hours trying to figure this out!

    Jennifer Bissex

  • 2.  RE: Google Tag Manager (GTM) on Flex Sites

    Cvent Staff
    Posted a minute ago
    Hi Jennifer,

    Thank you so much for sharing this great information with everyone!

    Megan Clark
    Assistant Team Lead, Online Community Marketing