Opt-out for multiple domain tracking not working
See original GitHub issueDescription
Hello, I’m trying to combine the use of multiple domain tracking, bootstrap and opt out but it doesn’t seems to be working.
Expected behavior
I would like for my user to be able to opt-in and opt-out simply by clicking on a button to activate it or not.
Actual behavior
When I’m calling this.$gtag.optOut(), it stops triggering the main id (UA-XXXXXXXX-1) but the id specified in includes (UA-XXXXXXXX-2) is still used to trigger events to Google Analytics.
Here is my code in main.ts:
Vue.use(VueGtag, {
config: { id: "UA-XXXXXXXX-1" },
includes: [
{ id: "UA-XXXXXXXX-2" }
],
bootstrap: false,
enabled: false
}, router);
And when I’m using it:
bootstrap().then(() => {
analyticalCookie.IsAccepted ? this.$gtag.optIn() : this.$gtag.optOut();
});
Maybe I misinterpreted something in the documentation and it works as supposed to.
Thanks in advance, I can give more details if needed 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Detect & Fix a Google Analytics Cross-Domain ...
Use this guide to diagnose and fix Google Analytics cross domain tracking issues before they ruin your data.
Read more >Implementing the Opt-Out Cookie - Tracking Visitor Sessions
Because cookies are domain-specific, if you have multiple domains, you need to set the opt-out cookie for each domain. If you have multiple...
Read more >How to set the google analytics opt-out cookie for sub- ...
I would like the opt-out of the cookie to be valid on all the subdomains. How to I accomplish this ? The code...
Read more >How to create an Opt-Out link for Google Analytics
Did you know that you must offer a link to opt out from Analytics tracking on your site? Here you are going to...
Read more >Tracking Multiple Websites with the ClickDimensions ...
You do not need to create a new domain record for each subdomain--it will work off your main domain record. You will also...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

That’s already what I’m doing but the permission can change during the user navigation.
My issue is this one:
this.$gtag.optOut()to stop sending events to Google Analytics. It works for our main id (UA-XXXXXXXX-1in the first post) but not for the one added in theincludessection (UA-XXXXXXXX-2). For this one, views events are still send to Google Analytics.🎉 This issue has been resolved in version 1.6.2 🎉
The release is available on:
Your semantic-release bot 📦🚀