Open Forum

 View Only
  • 1.  Google Tag Manager (GTM) installation

    Posted 02-16-2022 02:51

    Hello!  I am trying to assist our marketing team with creation of code snippets for GTM so that we can utilize the snippet within events.  With GTM, there are two code snippets needed to be placed --  one in the head, one in the body. I only see an option for one piece of code to be added per code snippet.  Can anyone explain how you are setting up these code snippets to work for GTM specifications?  I have searched threads but it seems this is not possible as of about a year ago.  Any updates? :)


    #Flex-Creating/ManagingEvents

    ------------------------------
    Christy Jenkins
    Associate Director, IT Program Management � Inform
    American Optometric Association
    ------------------------------


  • 2.  RE: Google Tag Manager (GTM) installation

    Posted 02-17-2022 02:43
    Hello Christy,

    My client success advisor provided this link for GTM.  https://support.cvent.com/apex/CommunityArticle?id=000100397 

    Per the article, I used snippet type initialization for the code to connect to GTM (head).  I placed the second code (body) into 2 other snippets  - "all website and registration pages" and "registration conversions".  In Flex, you must remove the <script> and <noscript> tags and all comments from the code.  

    My marketing team confirmed that the data is being captured. 

    Good luck!

    Cassandra

    ------------------------------
    Cassandra Perkins
    Director of Administration
    APG (America's Physician Groups)
    ------------------------------



  • 3.  RE: Google Tag Manager (GTM) installation

    Posted 02-17-2022 10:39
    Thank you!  This is super helpful.  Appreciate your reply.

    ------------------------------
    Christy Jenkins
    Associate Director, IT Program Management � Inform
    American Optometric Association
    ------------------------------



  • 4.  RE: Google Tag Manager (GTM) installation

    Posted 10 days ago
    After hours of searching and testing, I finally figured 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:

    This one goes in a snippet with the type Initialization:
    /* initialization snippet */
    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(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 */
    dataLayer.push({
    'event': 'cvent_page_view'
    });
    /* end pageview snippet */

    This one goes in a snippet with the type Registration conversions:
    /* reg conversion snippet */
    dataLayer.push({
    '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
    Maritz
    ------------------------------