Tracking one GA4 with 2 GTMs - How To Avoid Duplicates?

So I have a client who has 2 products and he wants to track those 2 products with 2 diffrent facebook pixels… What would be the easiest approach in this case so that I don’t have duplicate events inside GA4?

I though about using 2 GTMs, and in this case I need logic to make sure I don’t trigger events twice inside GA4…

Or can I simply use 2 facebook pixels inside the same GTM and just separate them with logic?

When I say logic I mean trigger page views, checkouts, purchases and leads separately for the 2 products because each of them has a separate pixel…

just lookup pixel id based on whatever the conditions for product 1 and product 2 are

@Dan hey dan bro long time no talk :smiley:

Can you explain in more detail what you mean exactly?

My current setup is that I’m triggering pageviews, checkouts and leads based on the URL because one product has tcb and other has tbb in the url…

For purchases I’m setting that up currently where I will use product ids…

Now from what you said I understood that if tcb product is visited cause that’s the condition for the page view, then I should also have a condition that will use the appropriate pixel for it?

Also, using one GTM and having 2 FB pixels on it to trigger for appropriate products is better than having 2 GTMs to avoid duplicate events for GA4, right?

You can use Data tag and send events through it to the server GTM. This seems to me to be a best practice not to use GA4 for non-Google platforms.
You also don’t need to duplicate GA4 if you do plan to use it and I don’t see the point in using two containers either.

The robot logic here is quite simple:

  • on the web container you define which pixel id should work via e.g. advanced lookup variable
  • you transfer the data to the Data tag/GA4 server, in the event data you also add the pixel id that should work (based on the advanced lookup table).
  • on the server, depending on the pixel id in the incoming request, you select it through the lookup table and your Meta tags work otherwise as usual

@Alex hey bro thank you for your answer. I ended up using one container, then I used different tags for different pixels because I need to trigger one pixel on product A pages but not on product B pages, and the second pixel needs to trigger on product B pages but not product A pages…

while GA4 should trigger on all pages so that’s setup normally.

I’m using URL with specific naming convention for product A and product B to differentiate the triggering tags for product A vs product B.

Works like a charm.

You could optimize this further by providing the measurement id dynamically into a single tag instead of using two seperate tags. Not that you need this necessarily