user4951834
user4951834

Reputation: 731

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!

Upvotes: 2

Views: 9405

Answers (2)

Fei
Fei

Reputation: 1

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

Upvotes: 0

Eike Pierstorff
Eike Pierstorff

Reputation: 32770

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.

Upvotes: 2

Related Questions