Date of slack thread: 5/6/24
Anonymous: Hello, I attempted to integrate GTM events with Statsig by following this documentation: https://docs.statsig.com/guides/sidecar-experiments/integrating-gtm However, I couldn’t see the required events in the log stream. Could someone please help?
Cooper Reid (Statsig): Hey! I just responded to your email on this. Do you have a link you can shoot me so I can troubleshoot?
Anonymous: Hey, just DMed you with details.
Cooper Reid (Statsig): I am seeing the GTM events in your account
Cooper Reid (Statsig): I see them in the Events catalogue as well as log stream
Cooper Reid (Statsig): Are you expecting to see other events?
Cooper Reid (Statsig): Open your Dev console’s network tools and you’ll see all the events hitting http://events.statsigapi.net and you can inspect the payload for events with gtm namespace
Cooper Reid (Statsig): Also, if you run localStorage.setItem(‘debug_ss_gtm’, 1); on your JS Console on the webpage, this will set a flag and the gtm integration will log all events that it’s sending once you refresh the page. Give this a shot
Anonymous: Hey, I couldn’t see events hitting http://events.statsigapi.net while moving through steps in our Instaquote app: https://go.cashforcars.com/qa/instaquote/ Each step completion triggers a respective event like select_year, select_make, select_model, etc; I couldn’t find them in Network tab or in Log Stream.
Cooper Reid (Statsig): I’m actually not seeing any events being tracked between those steps. Were you expecting to see events firing to Google Analytics?
Cooper Reid (Statsig): Sidecar integration aside, I don’t see any tracking associated with stepping through those actions.
Anonymous: Yes, I am expecting to see the GA4 events setup in GTM. Is there a different approach to push those events to Statsig?
Cooper Reid (Statsig): There are no GA events being tracked as I click through those steps
Cooper Reid (Statsig): I don’t think GTM is configured as you had expected, otherwise we’d be seeing GA events being sent over the network, as well as the same events being sent to statsig as gtm.
Anonymous: Here’s preview in tag assistant, as the events trigger when I click though steps.
Cooper Reid (Statsig): Do you see anything firing on the page?
Anonymous: It is an angular application within the iframe. Maybe that is the reason why we couldn’t see them firing on the page.
Cooper Reid (Statsig): Yes
Cooper Reid (Statsig): If GTM is on the parent page, it cannot track things taking place within the iFrame
Anonymous: However, they do fire in Application and GA4 receives it as GTM container is loaded in application side as well. What is the approach to push the same events to Statsig?
Cooper Reid (Statsig): There’s nothing firing in the network
Cooper Reid (Statsig): If GTM is implemented within the iframe page it should work if you’ve had the StatSig tag to that container
Anonymous: It’s the same container. Here’s the application URL (iframe source): https://c-services-qa5.copart.com/instaquote-ws/instaquote/index.html you could see GA events in Network tab.
Cooper Reid (Statsig): Okay, we’ll debug the two pages separately. I’m not sure what’s going on with the main production page because I don’t see any events being logged to GA
Cooper Reid (Statsig): Let’s focus on the c-services-qa5 page for now. I’m seeing that the routine that checks for statsig is timing out. In your GTM tag, can you try change this to a higher number (ie; 25)? I understand this isn’t the best way to do this type of thing, but we don’t really have a ‘ready’ callback you can attach to with Sidecar yet.