google event tracking - how to exclude subdomains - google-analytics

I am new to google analytics and did not really found anything what appears to be what I want.
I have a site:
https://www.example.com
domain would be example.com
I also have a subsite for testing which I do not want to track at all:
https://www.test.example.com
How would I exclude those events?
Setting up my tracker like this... :
ga('create', 'UA-xxxxxxx-x', 'auto', 'myTracker');
will result in getting events for all subsites of mysite.com.
Update:
Actually the domain I want to track is like:
https://www.prod.example.com
So tried filtering, excluding other subdomain test.example.com :
..without success.
Moreover I would not know how to exclude multiple subdomains.
Sorry for the german interace. Filter is :
Exclude->Pattern->Applyto->All

You can create include and exclude filters to track or block hits from subdomains. In your case, for example, you could create a filter that excludes all hits (like your event) from www.test.example.com. You can't direct where hits go in the hit itself, but you can filter them out in your views.
Edit: to exclude data from a specific subdomain, you would need to use a Hostname filter. It looks like you are filtering by Request URI (Anforderungs-URI) which would not work as that refers to the page path and not the hostname.

Related

Filter to exclude all traffic from all the sub-domains

I tried to create a view filter by excluding all the traffic from all sub-domains like .mydomain.com in GA, my exclude filter pattern is like this "\Q.mydomain.com\E" and seems not working. Because once the filter applied, it still showing visits from the sub-domains under the real-time active users right now home page.
Anyone knows how to do it, We have hundreds of sub-domains and don't want to create a filter for each one of them.
So the view only will include traffic is from the main domain - mydomain.com
Thank you in advance.
Real time is not accurate, if the filter is correct you will see cleaned data in the actual report.

How can I keep my referrer consistent when tracking a subdomain page in a Iframe.

I'm not sure how I should describe my situation and if I'm fully understand it.
Suppose we have a visitor flow that looks like the following:
User arrives, after a google search, at : example.com / referrer is google.com
Clicks to log in: sub.example.com/login.aspx (iframe page) / referrer is example.com
I’ve set the CookieDomain to auto and added example.com to the referral exclusion list. So from what I understand I have the following situation :
the Client ID stay consistant when I'm moving from step 1 to step 2. good !
However I'm concerned with the referrer. I would like to keep my google.com referrer when I'm moving from step one to step two.
How can I do this ?
I think you have two options here. Easy solution is to just look at your traffic sources in Acquisition reports in GA :
https://support.google.com/analytics/answer/1033173?hl=en
If you setup CookieDomain and refferal exlusion list correctly "traffic sources" will give you information you need.
Second option(if you really need to override the reffer) is to:
pass the "refferer" value from your parent page into your iframe. There are several ways how to do it but that's up to you.(e.g. query string or postMessage to iframe)
in your iframe pick this value up and send it to your dataLayer (in example below I name it {{yourValue}} )
then in your GTM you can set "reffer" field in your GA Tag for example:
Let me know if you need more detialed description on how to do it.

Track Goals across subdomains in Google Analytics

We have two platforms, a marketing site and a SaaS solution.
The marketingsite is on the main domain like www.domain.com and the SaaS solutions is on our subdomain sub.domain.com.
I would like to track the conversion rate of the customers signing up on our SaaS solution through our marketingsite.
If I go into goals for the marketingsite I can choose a relative path to the goal like www.domain.com/signup-completed, but the actual signup is on sub.domain.com/signup-completed. How can I track this on the marketing site?
The two sites are setup as different properties under the same account.
First of all, the property must be same for both subdomain and domain, i.e. same UA id.
Secondly, to track goals from sub domain, you need to include every part of the URL in the Page dimension. Normally you will not be able to distinguish which page is on which domain
For the above you need to create a filter that would modify the URL to include domain:
Steps:
In the View (Profile) Settings page, click the Add Filter link.
Choose Add New Filter and provide the filter a name.
Choose Custom Filter and select Advanced on the Filter type settings.
Under Advanced settings:
FieldA should be set to Hostname
FieldB should be set to Request URI
Set the values for both Field A and Field B to (.*), which is an
expression that captures all characters.
Set the Output To --> Constructor option to Request URI and provide
$A1$B1 as the value for that choice.
Your reports will now show:
www.domain.com/example.html
sub.domain.com/moreexample.html
This will capture the www.domain.com portion of your URL and include that at the beginning of your page URL in the content reports section.
You can then easily set the goals :)
PS: I would recommend to create new view, place this filter and then create goals, so that the data in other views wont be affected

how to track traffic across n domains with Google Analytics

Example: I have 3 sites, a.com, b.com, and c.com. How can I keep track of the traffic that starts out at a.com and ends up at c.com, using Tag Manager and Universal Analytics?
I know that using referral source is an easy enough thing to view in UA, but I really need referral referral source because UA only uses the most recent referrer, not a referrer n sites back.
Please note that this question is not just about cross-domain tracking, rather keeping track of a site visited before the current referral.
Using GTM
If you use GTM (Google Tag Manager), you must create a permanent variable that contains the domains where your site might go to or be visited from.
Lets call it "myDomains". It would be like this:
myDomains : permanent : "a.com,b.com,c.com" (without quotes)
After this, in your pageViews tags, you'll need to set some fields:
In "more configurations", go to "fields to set" add some fields and set the following properties:
Field Name : Value
allowLinker : true
And, if you use multiple sub-domains, add the following:
cookieDomain : auto
Now, still in the "more configurations", under "Cross Domain Tracking", you will use the variable myDomains (that we created before) on the "Auto Link Domains" as this:
{{myDomains}}
Now you just have to save it and now you can track your multiple domains.
Hard-Coded
If You don't use GTM and insert the tags directly to your source code, then what you need is similar to what we did in GTM:
ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['a.com', 'b.com', 'c.com'] );
Note that just like we did in GTM, we:
set the cookieDomain (implicitaly with "auto")
set the field "allowLinker" true
set the "autoLink" to an array of strings, each one containing one of the domains that will send/receive visitors to/from your site.
Note: if you use the same domain but just diferent levels of sub-domains, you will just need to set the cookieDomain to auto, no need for Cross-Domain.
Further reading
Google guide for this implementation
There is no real way to do this within the GA interface.
What you could do is create a new GA property that all these websites send data to (if you haven't already done so).
Then create a filter for this property that appends the hostname to the request URI. You can learn to so this here in the Google documentation. This will allow you to see the full URL thus allowing you see all websites.
I would then create two custom dimensions: sessionId and hitTimeStamp. These can deployed through Google Tag Manager. An article by Simo Ahava found here explains well how to do this.
Using SQL, you will be able to partition page by sessionID and order by hitTimeStamp to give you a view on page flow across each website to c.com.
I do not fully understand your use case, but you can catch the original referrer, store it somewhere (e.g. in a cookie) and then send it e.g. via the url to the following page. Then you catch the query parameter and use it in a set call:
ga('set', 'referrer', '<original referrer>');
ga('send','pageview');
For all hits following the set call GA will record the referrer as the value of ">" which you replace with your captured value.

Google Analytics Real-time overview shows a page that doesn't exist

I don't understand this. How can this happen?
I have an educational site and when I looked at Google Analytics I saw a porn page in active page which doesn't exist on my site.
What is this and how can I stop this from happening?
I checked for that page on my website and there is no such page.
This is not actually a hit for a Page on your website, it is rather a Referral (i.e. the source from which a user was supposedly coming from before landing on your site): https://support.google.com/analytics/answer/2795830?hl=en
It is actually spam generated by bots and crawlers, and you can follow the steps listed in this article to mitigate this issue: http://moz.com/blog/how-to-stop-spam-bots-from-ruining-your-analytics-referral-data
For the most common sources of Referral Spam, you might want to add an Exclude Filter to simply ignore those hits:
To filter out a referring source from your reports, create the following filter:
Filter Type: Custom Filter > Exclude
Filter Field: Campaign Source
Filter Pattern: Enter the domain of the referring source that you would like to exclude, for example, google.com. You can use regular expressions if you would like to exclude several referring sources.
If you are wondering about the "Active Page" view listing a spammy-looking URL, it is because that page most likely is a 404 page your website serves in response to the request.
Note that the URL also begins with a slash delimiter ("/"), as in yourwebsite.com/www.spammy-site.com -- this will show up in Analytics as /www.spammy-site.com, as in the examples above.
This is Ghost Referrer Spam, and it shows as both pages and/or referrals(you can see it in the screenshot bellow). This "visits" never reach your website actually. The only thing you should worry about is your data since it affects your statistics by adding useless data to your Google Analytics.
The only way to stop them for now is by filtering them in Google Analytics as #Philippe mention you can add a single filter or you can use a more general approach with a filter based on Valid Hostnames that will stop this and most of the Referrer Spam.
Basically, this works by excluding all hits that don't have any of your valid hostnames since the spammers don't know who are they targeting they use a fake or empty hostname as you can see in the screenshots
Here is more information about this solution and others https://stackoverflow.com/a/28354319/3197362
1 In Google Analytics, go to the Admin tab.
2 Go to View Column and select Filters.
3 Click on New Filter.
4 Put Spam Porn Referrals as a name for the Filter.
5 Filter Type select Custom. Filter Field, find and select Campaign
Source. In the Filter Pattern text box, copy and paste this Regular
Expression.
depositfiles-porn.ga|youporn-forum.ga|pornhub-forum.ga|generalporn.org|rapidgator-porn.ga|meendo-free-traffic.ga|amanda-porn.ga|torture.ml|pornhub-forum.uni.me
6 Click Save.
You can check this link also. I have seen the same problem and now i am done with this.
Stop Spam or adult site referrals in google analytics

Resources