Simon Breton
Simon Breton

Reputation: 2876

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:

  1. User arrives, after a google search, at : example.com / referrer is google.com
  2. 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 :

How can I do this ?

Upvotes: 1

Views: 775

Answers (1)

Matus
Matus

Reputation: 1418

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:

  1. 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)
  2. in your iframe pick this value up and send it to your dataLayer (in example below I name it {{yourValue}} )
  3. then in your GTM you can set "reffer" field in your GA Tag for example:

enter image description here

Let me know if you need more detialed description on how to do it.

Upvotes: 2

Related Questions