Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use context_campaign_referrer instead of referrer #49

Open
clrcrl opened this issue Apr 28, 2020 · 1 comment
Open

Use context_campaign_referrer instead of referrer #49

clrcrl opened this issue Apr 28, 2020 · 1 comment

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Apr 28, 2020

After a long and protracted conversation with Segment support, it seems that context_campaign_referrer should be used instead of referrer (referer?).

referrer: contains the address of the previous web page from which a link to the currently requested page was followed
context_campaign_referrer: The previous page according to the UTM parameters:
- context is Segment's word for the payload sent with the page ping
- campaign is their word for UTM attributes

Investigation

To test this, run:

-- replace "segment" with the correct schema
select context_campaign_referrer, referrer, * from segment.pages
where context_campaign_referrer != referrer
	and context_campaign_referrer is not null
	and referrer is not null

order by received_at desc
limit 1000

Inspect some of the results.

When running this (+ a few permutations) I found that referrer is filled in way more often than context_campaign_referrer.

Where both existed, context_campaign_referrer seemed to have "more interesting" results (i.e. an external website rather than an internal one).

Recommendation

I'm not sure which one is technically more correct (e.g. What Would Google Do?)

Next time we work with a client with Segment data, let's look into this. For now, if someone else finds this issue, it's possible for them to work around it by pre-processing this data to coalesce the two files together (or pass it through using the pass_though_cols variable)

@ciscodebs
Copy link

Google Optimize split URL testing passes the original "document.referrer" value in the "utm_referrer" parameter. Google Analytics will use "utm_referrer" over "document.referrer". Internal client-side sessionization logic I've built in the past, has used "utm_referrer" values if present over "document.referrer" so that is my preference. Happy to chat more about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants