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
BensTechLab
BensTechLab14mo ago
I create two triggers for "Is Production Site" and "Is Staging Site" and use them as "Blocking Triggers" for the incorrect GA tool instance.
BensTechLab
BensTechLab14mo ago
Create a rule matching URL hostname
No description
BensTechLab
BensTechLab14mo ago
Then use a blocking trigger to prevent loading the wrong GA4 instance
No description
BensTechLab
BensTechLab14mo ago
This blocking trigger is on the "Tool" level so that it affects all triggers.
Rapid
RapidOP14mo ago
Interesting! gonna give it a try. Thanks dude! Thanks @BensTechLab works wonderfully!
BensTechLab
BensTechLab14mo ago
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!
BensTechLab
BensTechLab14mo ago
Here's a sample with bogus IPs:
No description
Rapid
RapidOP14mo ago
Interesting! even though I believe we can filter them after if needed. @LiranM - what do you think?
BensTechLab
BensTechLab14mo ago
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!
Combwe
Combwe14mo ago
@Rapid Yes it works both inside GA or with Zaraz
Rapid
RapidOP14mo ago
Ahhh, understood

Did you find this page helpful?