You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added UTM query param parsing to frontend scripts (#24827)
ref https://linear.app/ghost/issue/PROD-2560/
- added utm_ params parsing to the url-attribution helper library; this
lib returns the referrer/attribution data we use for memberships in
ghost
- refactored url-attribution script file to be easier to read/make sense
of; updated tests accordingly (tried to decouple a bit w/
implementation)
- updated member-attribution script to pass along utm data; this isn't
wired up on the backend yet
The `url-attribution` helpers are used by the `member-attribution` and
`ghost-stats` scripts, which are our frontend scripts for handling
attribution (member signups + web traffic). We need to update these to
pass along the various `utm_{param}` query params in order to support
expanding our attribution and analytics data sets.
This change allows us to pass along the data, and we'll need follow-up
PRs to handle ingesting that data and properly storing it.
I've included a bit of a refactor here to try and make better sense of
the url-attribution script. This has some confusion because historically
it has been used for member attribution which has a confusing
relationship with referrer data. We haven't been clear about what we
call this.
__Testing__
In terms of testing, we should only need to check that the frontend
scripts store the additional data. W/r to member-attribution, you can
check `sessionStroage` and ensure the `utm_{param}` fields exist in the
JSON data. For ghost-stats, you can look at the request payload sent to
the traffic analytics proxy.
0 commit comments