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
------------------------------
Original Message:
Sent: 03-05-2021 17:12
From: David Blatner
Subject: Google Tag Manager
Thank you, Jodi. I really appreciate your following up with this. However, I need to point out that I've been working with the Cvent support team on this since August, 2019 (including hours of calls, exchanged emails, etc) and they have made zero improvements. The idea that they are "in the research phase" is… well, it's a little disappointing to read.
------------------------------
David Blatner
President
Creative Pro Network
Original Message:
Sent: 03-05-2021 15:05
From: Jodi Meier
Subject: Google Tag Manager
I want to circle back on this thread to let everyone know that we elevated your concerns to the product and support teams.
The product team is looking into approaches to make using Google Tag Manager (GTM) in Cvent easier but are still in the research phase so they cannot provide an expected timeline. To follow the status of GTM enhancements I encourage you to upvote and follow the Google Tag Manager (GTM) vs Google Analytics (GA) idea in the Ideas section of the Community.
In the meantime, the support team is also looking if there is further guidance or additional documentation or that can be added to the Knowledge Base.
Thank you all for your candid feedback!
------------------------------
Jodi Meier
Online Community Manager
Original Message:
Sent: 02-26-2021 04:44
From: Matt Ackroyd
Subject: Google Tag Manager
Hi Hilary and David,
I've been similarly frustrated, although I had a meeting with the Flex Product Manager who assured me GTM integration would be possible in H1. As it's a one page application, it's not currently possible to add the code to both the header and footer. I've had some success with adding the header code (without script) which is allowing us to fire tags.
From an SEO perspective, I'm also having difficulties. If anything Flex is a step back on the capability you had with Classic.
------------------------------
Matt Ackroyd
Product Manager
Euromoney Trading Ltd
Original Message:
Sent: 02-25-2021 10:27
From: Hilary Wickes
Subject: Google Tag Manager
Did you ever figure this out? I am in the same boat and CVENT customer support didn't seem to know/ suggested I hire a developer. *sigh*
------------------------------
Hilary Wickes
Marketing Coordinator
America Outdoors Association
Original Message:
Sent: 06-01-2020 08:24
From: Matt Ackroyd
Subject: Google Tag Manager
Hi all,
Has anybody had any success implementing Google Tag Manager to their flex sites?
The Google Tag Manager container snippet is needs to be placed in both the header and the body - has anybody managed to achieve this?
Best wishes,
Matt
#Flex-Creating/ManagingEvents
------------------------------
Matt Ackroyd
Euromoney Trading Ltd
------------------------------