Hi Yoav,
Hi Yoav,
I have a different GA4 for staging and different GA4 for my production env. How can I make sure each one of them is sending to the right GA id.
So I create 2 GA4 with different id's, but how do I configure which one needs to go there?
11 Replies
I create two triggers for "Is Production Site" and "Is Staging Site" and use them as "Blocking Triggers" for the incorrect GA tool instance.
Create a rule matching URL hostname

Then use a blocking trigger to prevent loading the wrong GA4 instance

This blocking trigger is on the "Tool" level so that it affects all triggers.
Interesting! gonna give it a try. Thanks dude!
Thanks @BensTechLab works wonderfully!
BTW, I also added a "blocking trigger" named "Team Member IPs" and used a regex matcher to stop google analytics from reporting website visits from a few team member home office IPs. This is also working great!
Here's a sample with bogus IPs:

Interesting! even though I believe we can filter them after if needed. @LiranM - what do you think?
You can certainly filter them inside google analytics. But I'm trying to stay "analytics platform neutral" in case I switch to another analytics platform in future for GDPR.
There is no "right answer" - but just another tool in the toolbox!
@Rapid Yes it works both inside GA or with Zaraz
Ahhh, understood