Andrei Ionita
Andrei Ionita

Reputation: 1

Referral data for utm-tagged traffic in Google Analytics

I was wondering if it would be possible to retrieve the actual referral data for traffic that lands to my website and has utm parameters.

The reason why I need that is because my system uses "utm_source" to distinguish between traffic sources for internal reporting (like affiliate networks for example) but those traffic sources are sending me traffic from a network of publishers and I need to have that referral data.

Thank you!

Upvotes: 0

Views: 95

Answers (1)

Igneel64
Igneel64

Reputation: 618

As I think, Google Analytics uses the document.referrer variable of the webpage to define where the user came from. Based on that you can set a user-scoped custom dimension and set it each time the user comes to your site. If you use analytics.js library directly, something like this could be achieved as follows: Set it before the pageview hit in your page, and send the pageview as usual

ga('set', 'dimensionN', document.referrer);
ga('send', 'pageview');

That is a basic solution that can be tailored depending on your needs for data analysis afterwards.

Upvotes: 1

Related Questions