Analytics Hostname Filter Removes Domain - google-analytics

I have an extremely weird filter issue with Google Analytics and Shopify. It used to control spam referral issues and control page views for just the store.
A view is setup that includes only the store's subdomain and its checkout based on the hostname filter field. I have tried these filter patterns:
store\.domain\.com|.*shopify\.com
store\.domain\.com|checkout\.shopify\.com
^(store\.domain\.com|checkout\.shopify\.com)$
The only pages included have a hostname of store.domain.com. No pages on shopify.com ever get included. It's only when the filter is removed altogether that page views on the shopify.com start appearing.
Here's where it gets weirder.
I have an unfiltered view setup where I run the exact filter patterns on the hostname as an advanced segment. Pages on the sub-domain checkout.shopify.com show for any of the filter patterns.
Secondly, I confirm the pages disappearing in the analytics reports have a hostname that is exactly:
checkout.shopify.com
Any further debugging ideas? Possible explanations?

The reason why your filter isn't working is because the Checkout at Shopify uses virtual pageviews instead of the regular ones, in order to have neat names that make your reports and funnels clean instead of leaving a bunch of meaningless IDs like the ones you see in the URL. These pageviews don't contain a hostname.
Now you may be wondering why it worked in your advanced segments. If you check your Hostname report (under Audience > Technology > Network) you'll see the checkout.shopify.com hostname there, but with 0 sessions and some transactions. That's because it was the ecommerce tracking code that sent the hostname value that you saw in your segment, not the pageview.
One solution in this case is to create your filter in two steps.
1) Merge the Hostname and Request URI into Custom Field 1 with an Advanced filter. If Hostname is your Field A, make sure you leave "Field A Required" unchecked.
2) Filter the custom field for store.domain.com|/checkout
On a side note, my preferred method to avoid spam in to simply create a new property. You'd be surprised how most spammers only target UA-XXXXX-1 and leave alone all others properties. They are probably just using the Measurement Protocol to send fake data and they generate the IDs programatically instead of actually going through the trouble of finding the code on the site.
I hope that helps, and don't hesitate to contact me or Shopify's support if you need any extra help.

Related

GA Page View tracking with additional information

We have a site where users login to access technical information. Before accessing the information, they also have to enter a set of filter options. Different filter options result in different information displayed on different pages but the url is the same.
For example, a user will get the following URL when accessing a specific document, regardless of what filter options set:
www.site.com/fr/category/document/
Depending on the filter options, different sections of the document will be visible.
Currently, no information in GA tells us what filters were used when visiting the page. We do not want to add filter parameters to the URL. At least not for the visitor, but maybe add it in the tracking somehow?
What would be the optimal/correct way to track that kind of information?
Best solution may depends how your site works etc. But how about using custom dimensions assigned to "hit" (pageview) scope? Maybe they will help in your case? Documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets (code in documentation depends how your GA is implemented of course). Thanks to them you can send with pageviews hit additional (custom) information (e.g which filters were used).
Other way could be just sending google analytics event (https://developers.google.com/analytics/devguides/collection/analyticsjs/events) with information which filters were used before pageview hit. Then just in Google Analytics panel you can create custom segment with sequence where 2 events occurred:
Click (or use filters) - event
See specific URL - pageview
Or of course you can implement both solutions (custom dimensions for pageview and events).

How to track traffic by domain in Google Analytics?

I am using Google Analytics in an embedded form. This form will be placed on various websites, and I want to track the traffic with GA. Creating a new property in GA for each website that embeds the form is not an option. As such, I'm looking to track traffic from all the websites using one GA Tracking ID and segment the data by domain. However, I'm having trouble figuring out how to customize the GA code snippet to do that -- everything I find refers to the old classics GA code and not the new universal code. Can someone please help?
Thanks!
You do not need to customize the code, the domain is tracked automatically in GA in the "hostname" field. Go to your GA admin panel, set up a new view, create an "include" filter and set field to "hostname" and the value to the hostname that you want to track. Repeat for all your domains.
You can create up to 25 views per property.
If you do not need a permanent solution you can track everything to one view and create segments based on the value of the hostname field. Or even more ephemeral, set the secondary dimension to "hostname" in your data tables and use the filter in the upper right of the table to filter by value of the secondary dimension.
Google's official answer is here: https://support.google.com/analytics/answer/1012243?hl=en
by default GA is only showing URI, without hostname. You could follow above link, to add a filter to "include hostname in URI".
this video could be more instructive: https://www.youtube.com/watch?v=tcBg6QfgWR8

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

Spam Referral people on my Wordpress

for some time in google Analytics I observe very busy with foreign sites. These are spam site. How can I protect?
Screen GA:
http://oi60.tinypic.com/2vctdae.jpg
These are called "Ghost Referrals" and the best way to rid yourself of them is to add a new view and create an Include filter for it.
Check out the full post http://blog.tylerbuchea.com/google-analytics-filtering-out-ghost-referrals/
First go the the Analytics Admin section and choose the Account and Property you'd like to apply the filter to. Then create a new view like "example.com (Ghost Referalls Filter)". Trust me on this create a new one and don't reuse your existing one. I'll explain later.
Add a new filter to your freshly created view. Then select the Custom tab, mark the Include radio button, and choose Hostname from the dropdown. Then you'll want to enter your sites hostnames separated with the OR operator "|" and make sure to add a backslash before each period. This will white list only your hostnames and block any other sites from sending fake data that muddy up your Analytics reports.
Example entry
example\.com|www\.example\.com|translate\.google\.com
So Why The New View?
If you add a filter to an existing view it will permanently change that view and all of the past data.
I Don't See Any Data
Unfortunately Analytics doesn't apply filters to past data. So all of the data in the filtered view will be from the day it was assigned onwards. Just give it a few days and you'll be using your original view less and less.
If your picture is what I think it is, its actually a GA issue. Its fake referral spam.
https://megalytic.com/blog/how-to-filter-out-fake-referrals-and-other-google-analytics-spam

Duplicate domain tracking on Google Analytics issue

We've accidentally placed the same Google Analytics tracking code on two different domains.
www.y.com
www.x.com
We've rectified the issue now but retrospectively, is there any way to filter that data going to the specific domain name www.x.com for example?
Note: this is not a duplicate of Google Analytics: Track two domains as one
You could add a filter to the view (profile) in question. That will remove the data that you don't want. Another option if you don't want to loose the data in the view would be to create a custom segment that you could use when ever you want to split the data out.
Update from Google+
You can search with regex
^/app/
in the small search bar (custom segment) in your page reports (e.g. Behavior -> Site Content -> All Pages), after which you can look at the aggregate metrics for all pages which start with /app/ (i.e. all the pages with different parameters).
If all the /app/.* have the same page title, you can look at the Behavior > Overview report, but choose Page Title as the dimension.

Resources