Block Google Analytics tracking in specific URL - google-analytics

My website is running a lot of test pages for specific purposes. Problem is I don't want to count these session and page views in Google Analytics, because we will have lots of false traffic. So I need to block these traffic data in Google Analytics.
Notice 1: Exclude IP filter won't work. We use VPN for these test pages. We also test it anywhere.
Notice 2: Custom Reports or Segment or anything are not recommended here. I know how to do this but don't want to do.
Notice 3: Website is Wordpress but I can't access to edit htaccess or to remove GA analytics.js.
Notice 4: I am able to use Google Tag Manager. Any Tag Manager tips are welcomed.
Thank you.

You should use Google Tag Manager and set up rules based on URL in triggers.
UPD In case of hardcoded GA, you can use custom filter in GA View: exclude traffic from Request URLs.

Related

How to set up cross-domain tracking in GA4?

How to set up cross-domain tracking in GA4 right?
I followed official instructions: [GA4] Set up cross-domain measurement
I've added all the domains I need to the Date Stream Details - More Tagging Settings - Configure your Domains.
Added 'Google Analytics: GA4 Configuration' tag on the website using Google Tag Manager.
But now, when switching between domains, a lengthy parameter
(smth like "?_gl=11lop9ld*_gaNDcxNTp2McYzKjE2LTcxMjQwKLv._ga_3JP1WO1NB3MTYxNzEyNDA4Ny8xLjEuKOPxNzEyNLI5Ny40Nw..")
is added to the page address and the page does not open, a 404 error appears.
What could be the problem?
As #Tony McCreath said, It might be a problem on the website's end on handling unexpected query parameters. I already faced this problem while working on a client website, and there was nothing that could be done on the Analytics side to fix the issue. You can test if that's the case by adding any random parameters at the end of the URL to see if the website still works.
The lengthy parameter that is added to the URL is the way Google uses to identify that a user is coming from another domain. It's basically an ID that will link the user from the previous domain to the current one.

Google analytics - allowed hosts

I'm seeing entries in my analytics data for pages that no longer exist.
This could be developers looking at legacy versions of a site, it could also be triggered by something like wayback machine.
Is there a way to either identify what hosts an analytics tracking pixel is being triggered on, or restrict analytics to only execute on either a set of domains/hosts or ip address
LinkedIn campaign manager and Hubspot have features where you can tell the tracking script what domains to include/exclude
This is different from excluding ip addresses when setting up filters
Thanks
you can use filters on view level (Universal Analytics, not GA4) in order to exclude or include specified domains to ga data. Keep in mind, adding or removing filters work for new collected data only. Maybe add an additional view, so one view contains all data (based on your ga setup). With this solution GA collects data but will not show the data in the filtered view.
In order to fire the ga tag on a specified domain, specify the host in the trigger in Google Tag Manager, if it is implemented on page. This setting the tag will not be fired on other domains.
If there is no Tag Management on the page, you can check the domain using js before firing the ga script.
Keep in mind, that it is possible to send data to GA without fireing the GA tag by using Measurement Protocol. So if a lot of spam data appears in the interface, may add additional filters to exclude this data aswell.

Ban a URL from showing up in Google Analytics

All,
There is a website that doesn't seem legitimate that and keeps showing all of these page views in my google analytics. Is there a way to ban certain URLs from being processed in google analytics?
You can make an IP address not show up by adding it to a filter.
Please look at http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55481, even though it talks about excluding internal addresses, it should work well as a guide how to do it with the "difficult" site too.
Edit: To filter on referrals you need to create a custom filter.
See http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55492 for a guide.
http://support.google.com/analytics/bin/answer.py?hl=en&topic=1034830&answer=1034842 talks specifically about excluding referrers.
Note that the filters will only act on future data, the referrals that are already collected will still show up.

Does anyone use Google Analytics? How Google does it to avoid counting the owner of the website as visitor?

I don't want to be counted as visitor every time I test my page in the hosting. Does Google know i'm the owner of the site by checking if i'm logged in my Gmail account?
I don't think Google does anything like this automatically. But they do provide instructions for excluding based on IP address (or range) and apparently also now by cookie. If you use a CMS or admin interface, you could put the code they provide in an HTML file that you then include into the admin interface pages by IFRAME (to ensure that the cookie stays set for anyone who uses that interface).
One option is to install Ghostery addon your browser. Ghostery can block trackers and scripts used on webpages likes google analytics, google adword and other adwares.
You can also block or unblock the trackers for a specific site or specific tracker for a particular site.This add on is available for Firefox and chrome browsers. If you have this installed on your browser, your visit wont be counted as google analytic script wont be executed.
You can learn more about ghostery at: http://www.ghostery.com/about
There are also often application specific ways of blocking google from counting administrators. For example I've used a wordpress analytics plugin that would automatically not include the tracking code if the user was logged in as an administrator. If you are application has the concept as admin then you could write something similar that controls when the code is added.
If you visit your site frequently from connections with a dynamic IP address, eg. home broadband, then excluding IP addresses is not particularly practical. To go beyond IP exclusion, you can create an isolated page on your site that only you know about that includes a call to Analytics to label your cookie.
The Google Analytics _setVar() function lets you label yourself with an arbitrary string, eg. 'internal'. You only need to do this once per browser as long you don't clear your cookies.
Having labelled yourself as 'internal', you can create an Advanced Segment within Google Analytics to exclude visitors with that label.
Google Analytics relay on you embedding a call to their JavaScript see this link - do not confuse it with how Google does page ranking.
So the answer to your question is that your pages should be smart enough to recognize when the request comes from you and skip the call to the JavaScript.

Can I filter out my traffic in google analytics?

I have a site running Google analytics and I end up being a large fraction of the traffic to it (like 1 of the 2 hits per day). Is there any way I can set it so that my browsing doesn't skew the numbers so much? I'd be happy if it just didn't record anything for accesses that are logged in as my Google account.
Use the Filter Manager in your analytics settings
http://www.google.com/support/analytics/bin/answer.py?answer=55481&cbid=-1j8it19c4uzvt&src=cb&lev=answer
You can use filter to exclude
Traffic from a a domain
IP address
Sub directory
or you can use a custom filter. You can edit your site to set a campaign code if you login in and use the custom filter to exclude that campaign code.
You can also try out the ip filter if you use the same machine.
One option would be to use an ad blocking or javascript disabling extension in your browser to prevent google analytics from being loaded.
A neat solution is to simply stop the tracking javascript from being sent to the browser based on a cookie set on your machine. This can be done by simply adding a few lines of code to your page. Take a look at this article for a full explaination.
If you login there logged in as a site user, maybe you basing on this you just do not put the JavaScript for Google Analytics in the output HTML. This is a typical case when you are an administrator and you do not want to mess the results basing on your activities.
If you are able to touch the code that runs your site I think this is the simplest way to go.
If it is not the case, please provide some more details.

Resources