Modify Google Analytics Script To Only Cookie U.S. Sessions
-
I know I can filter sessions from outside the US, but is there a way to modify the GA script so that it doesn't cookie visitors to a site if they are from outside the US?
Note, this is separate from having a cookie consent opt-in.
Thanks in advance,
Fitz -
I'm running a game blog and hosted on Wordpress. I'm also facing the same analytics problem. Check out my website stat.
-
Hey, thanks for the response. Legal department wants to eliminate all tracking of EU visitors to their US site (i.e. no Google Analytics cookies/tracking). They already have GDPR and cookie consent implemented, but as far as legal is concerned they want no risks so they wanted to know if GA could be altered to not track site visitors from the EU while still tracking all other site visitors.
Since they don't want to block visitors from the EU from being able to visit the site and I'm not aware of a way to tell GA not to cookie visitors from specific locations, I thought I would ask if there was a way. Right now best solution I have is to redirect EU visitors to a newly created landing page (or microsite) which doesn't contain GA script. That way they can still learn about services, but there is no risk of GA tracking and they can't hit the main site where tracking is enabled.
Any better ideas are welcomed.
-
As the question is interesting, I went to search and I did not find anything that explains hoot legitimately modify the GA tracking script. May I ask you why do you want the script to not cookie non-US visitors to your website?
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How do I exclude fake direct load traffic from networks in Google Analytics?
Starting on Friday 1/20, we noticed a huge, unnatural spike in Direct Load traffic. While researching where it was coming from, the big flags were huge spikes in countries that normally only have <5 sessions a month like Russia, Singapore, Brazil, etc., each sending 1400 a week, with >99% bounce rate and <0:00:05 average session duration. While looking into networks, we saw an influx in Networks that had never sent traffic before, each with >1300 sessions a week, 100% bounce rate, and 0:00:00 session duration. The list of these Networks are: astute hosting usa incorporated
Reporting & Analytics | | ServiceMichael
nephoscale inc.
network transit holdings llc
serverbeach
coreix ltd
2ezhost llp
nforce entertainment b.v.
mir telematiki ltd
servers australia pty ltd wholesale services provider for abuse
reliablehosting
dimenoc servicos de informatica ltda
c0715718213 I have seen a lot of guides of filtering out Referral traffic, but these are all coming in as Direct Load and are skewing our Direct Load results. Any idea how to filter or remove this traffic from Google Analytics?0 -
How to exclude traffic for a specific mobile device in Google Analytics view?
Hi, Need help on how to exclude traffic for a specific mobile device in Google Analytics view. I have been searching and the only information available is excluding IP address of internal traffic. Is there any way to exclude traffic through a mobile MAC address?
Reporting & Analytics | | Khadija_K0 -
Most of the goal conversion in Google analytics showing under referral
Hi All, I have already asked this question twice here but issue is not resolved yet. http://moz.com/community/q/all-goal-conversion-in-google-analytics-showing-under-referral http://moz.com/community/q/some-goal-conversion-in-google-analytics-showing-under-referral In Google analytics most of the goal conversion in Google analytics showing under referral from payment gateway sites (Paypal.com & epdq.co.uk). I have applied all the possible solution that suggested by Moz community experts & Google Adwords support team but it is not resolved yet and it is really weird answer to give client that I have applied all possible solution and issue is still not solved. Lastly I am sharing Cross domain tracking code here that I have used on my site. Please check once and let me know if code is correct and If not correct please help me out to correct the code or suggest any other way to fix the issue Cross domain tracking code ======================= <script type="text/javascript">(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Reporting & Analytics | | Alick300
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('require', 'linker');
ga('linker:autoLink', ['paypal.com', 'payments.epdq.co.uk'], false, true);
ga('create', 'UA-xxxxxx', 'auto', { 'allowLinker': true});
ga('require', 'displayfeatures');
ga('send', 'pageview');</script > I have hide the UID in above code. Thanks0 -
Exporting Keywords in Google Analytics
In the old Google Analytics, I would simply add &limit=30000 in the URL. Does anyone know how to export all keywords from the new Google Analytics?
Reporting & Analytics | | TommySwanson520 -
Set up Google Analytics by product category
Does anyone know if it's possible to set up Google Analytics data by product category? We sell roughly twenty product categories on our ecommerce site. We can look at our analytics performance for the site overall and drill down to specific pages, but what we really want to see is our performance by product category. Our product categories can include up to 5000 products. Any pointers on how to do this?
Reporting & Analytics | | ironpac0 -
Is there a way to use Google Analytics event tracking for YouTube embedded videos on my website?
Hello! I am trying to track different types of interaction on the YouTube for videos which are embedded on a website to measure the interaction on these video from my organic traffic. Is there a good way to go about this with the code since these are coming from an iFrame on YouTube? Would appreciate any feedback or help on implementing the event tracking with YouTube videos. Many thanks!
Reporting & Analytics | | CabbageTree0 -
Entrance keyword for specific landing page Google Analytics V5
Hi all I cant seem to find a way to get Entrance keywords for a specific landing page in version 5 of Google Analytics. Any quick tips? Thanks a million Fredrik
Reporting & Analytics | | Resultify0 -
How can I track search engine optimization data in Google analytics?
My website is linked to a Google Analytics web property. But, I am not able to track search engine optimization data in Google Analytics. So, How can I get it done?
Reporting & Analytics | | CommercePundit0