Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
feat(Pixel): read & prefer ?ref over header
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Oct 6, 2018
1 parent d5485d3 commit 39606c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/gatsby-plugin-pixel/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const onRouteUpdate = (
) => {
if (typeof enabled !== `undefined` && !enabled) return
const isRecurring = !!views[pathname]
const { utm_source, utm_campaign, utm_content } = parse(search)
const { utm_source, utm_campaign, utm_content, ref } = parse(search)

views[pathname] = isRecurring ? views[pathname] + 1 : 1

Expand All @@ -49,7 +49,7 @@ export const onRouteUpdate = (
sr: `${window.screen.width}x${window.screen.height}`, // screen resolution
}

if (referrer) query.dr = referrer // document referrer
if (ref || referrer) query.dr = ref || referrer // document referrer
if (utm_source) query.cs = utm_source // campaign source
if (utm_campaign) query.cn = utm_campaign // campaign name
if (utm_content) query.cc = utm_content // campaign content
Expand Down

0 comments on commit 39606c5

Please sign in to comment.