0

New to google tag manager, I have just moved my ga4 tags to it and I have the following set up, intentionally under 1 container.

mydomain.com (gtag 1) site2.mydomain.com (gtag 2)

I am using a lookup table against the hostname so that events are sent to the relavent gtags for the 2 sites, which are quite different in structure. (sales portal vs admin portal).

I wish to send a custom event that occurs in site2 (signup) to both tags, so that a sales journey that started in site 1 and ended in a user signing up in site 2 can be marked as a complete journey/conversion.

I have successfully set up such an event in tag manager, by using comma seperated measurement ID for this event. In preview I belive I am correctly seeing the event being sent to both tags.

However I see this error in the preview window

This Google tag should have been loaded before sending an event. To fix this, add a Google tag for G-xxxxxxxxx to your container and configure it to fire on the Initialization - All Pages trigger.

Because of course site1 was not initiallised until this event and this was the only event I desired to return.

My question is 2 fold.

Do I need to worry about this initalisation? note, I dont wish to send any other events from site2, only a few custom events that I will specific in this way.

secondly, do I need to include any specific information in the parameters for anaytics to be able to link this event back to a user journey in site1 ? Both sites are under the same domain.

thank you

1 Answer 1

1

Seems like you've read this: Google Tag Manager equivalent of adding multiple IDs with gtag( 'config' ) and this linkedin post.

If not, you should.

In short, it's an ugly implementation since it sends unneeded network calls to nowhere and confuses future engineers who's gonna look at it. Plus, this is likely an unintended (surely undocumented) hack that can be fixed in the future by the GTM team without notifying you.

Just make another tag or a few. Seems like you only need it for a few events. Unfortunately, GTM didn't bother to make a proper way to set multiple destinations for a tag. Maybe because now different destinations aren't just different measurement ids, but different versions of tracking libraries each of which has to be loaded behind the scenes before the actual events are sent.

Pretty awkward logic, but it does solve a few issues like an ability to somewhat meaningfully configure the default tracking behavior directly from a GA4 property for people who don't know how to use GTM.

1
  • Creating a second tag instead resolved the initalization problem. thanks
    – Ray_Hack
    Commented May 31 at 11:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.