Considering a site that exposes a dynamic range of hostnames... Is there a way to use the hostname as a dimension in reports?
There are docs related to hostname, but not doing what I want. I've seen things on filtering by hostsname in a profile, or having a profile filter that adds the hostname to the path GA uses. I would rather use the hostname as a secondary dimension in reports.
One option I have is to add the hostname as a custom variable. This seems wasteful though, as each request is only allowed 5 custom variables and the hostname is already transfered as part of the google analytics beacon. I see the hostname included in the request to __utm.gif as querystring parameter utmhn.
Yes.
Any report's secondary dimension selectors will allow you to set hostname as a secondary dimension.
You can even access it as a primary dimension by navigating to Visitors->Network Properties->Hostnames (or, in the new GA, Visitors->Technology->Network->Hostname).
Related
I want to have Google analytics ignore all traffic that comes with a specific query parameter, ?mysearch=1
I am using that query parameter from an internal tool that I cannot change nor can I have the tool use a specific user agent, it's an ancient monitoring tool that I am being mandated to use.
It will always hit the site at a few different specific URLs, e.g. https://example.com/?mysearch=1 or https://example.com/about/?mysearch=1 or https://example.com/team/?mysearch=1
There will never be a time that real traffic will have the ?mysearch=1 query variable.
You can try to use a segment when you see your Analytics data that exclude all users that contains page with ?mysearch=1. So you can see report without these users.
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.
When I added the filters to Google Analytics (https://support.google.com/analytics/answer/7476333) to show the full hostname with the subdomain, no traffic was showing up when testing it out on just the primary domain (without www).
What's the proper way to set up filters so that it tracks subdomains and domains without a subdomain?
There is only one filter listed on the linked page. It is a commonly used filter and does not exclude data. It simply prepends the hostname to the requestURI in the GA reports.
If you are trying to track a subdomain of the primary domain and the primary domain, having tracking for the same Property on both with the cookieDomain set to auto (which it is by default)and the filter applied should be all that is needed.
If you are trying to track a primary domain and subdomains of a different domain, then if you are are trying to preserve referral and session data across the two, then you will need tracking for the same Property on the primary and subdomains, configured for cross domain tracking setup as per the article and the filter applied.
One weird issue I have come across (and it happens really randomly without rhyme or reason), is a view not reporting data, until the Save button on the view settings page has been clicked.
Usually the three most common issues i see are:
1) Tracking for the same property as the primary domain not being installed on the subdomain(s)
2) Tracking for multiple Properties being installed, setup with incorrect configuration for multiple trackers.. which can cause all hits from all trackers to get sent to just one Property instead of all Properties
3) Incorrect filters applied or incorrect filter order. Filters run in the order they are applied/added to a view. The order of the filters, needs to be set in the Filter table for the particular view.
Example of incorrect filters -
a View with a hostname filter to include only the Primary domain hostname, that also has the above filter applied, will not show any data for the subdomain(s) only the primary domain.
Okay, this may be a stupid question. I have setuped a Google Analytics account to analyze the traffic of my own site (online portfolio).
My question is: How can I exclude the traffic from me?
Can I just simply get my public IP address and exclude it? Will it change?
If it will, how can I effectively exclude the internal traffic? Many thanks!!!
Just set up Ghostery plugin on your main browser and use only this browser for working with Your site.
Simple and very effective.
Yes, your IP address is likely to change over time.
IP filtering is best used for corporate networks, which have static IP addresses (or range of IP addresses). IP filtering is unlikely to be useful for individuals.
The best way to filter out your own traffic would be to create a Custom Dimension for User Type, and have your CMS/Portfolio application fill out its value depending on visitor's log-in status.
1. Create a Custom Dimension in Google Analytics
Navigate to the Admin Section of Analytics, and create a new Custom Dimension for User Type.
For reference and/or more details, see the official Google
documentation about creating Custom
Dimensions.
2. Create filtered Views in Analytics
Still in Google Analytics, you can set up multiple Views and use filters to remove yourself from the traffic logged.
For example:
Leave the default View provided as a "Raw & Unfiltered View".
Create a new View, "Visitors only", and apply an "Exclude Filter" based on your Custom Dimension, preventing "Administrator" hits from being displayed.
For reference and/or more details, see the official Google
documentation about creating a
View and
managing View
filters.
3. Have your CMS/Portfolio print the user status for each view
For example:
When User is logged in as Administrator/Contributor, have the application output:
ga('set', 'dimension1', 'Administrator');
When User is anonymous, have the application output:
ga('set', 'dimension1', 'Visitor');
Unfortunately, you might have to look for plugins and/or do code it yourself, depending on your application.
I have my site.com and blog.mysite.com on a different IP address. Can I use the same Google analytics ID for both sites? Does Google analytics look at what IP address the recorded visitor information is from? If it doesn't, what prevents random sites from including your Google analytics tag and sending random data to your account?
You have to modify your script tag a little. Google's FAQs cover this:
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55524
You can run any UA-XXXXX-YY on any website (any domain name, on any IP), it will end in your profile stats.
Yes, your stats could get completely messed up if some site would put your UA id on its site.
To prevent this, you can setup an include filter on your GA profiles, and Include only your domain names by using a regep like this "www.domain1.com|www.domain2.com|www.domain2.com" on the hostname field.
Be careful, the Include filter is exclusive (If you have 3 Include filters on the field hostname, only the first one will be applied).
The alternative is to create an advanced segment based on the hostname, you'll get mostly the same result but could be exposed to data sampling effects if you have a large audience. But it allows a quick fix afterwards, while filters need to be set before you get into trouble.
Sure. you can use the same for both. You will be able to segment traffic by domain name.