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

Add custom properties for UTM code information #2034

Closed
3 of 13 tasks
Tracked by #2036
thekaveman opened this issue Apr 17, 2024 · 2 comments · Fixed by #2056
Closed
3 of 13 tasks
Tracked by #2036

Add custom properties for UTM code information #2034

thekaveman opened this issue Apr 17, 2024 · 2 comments · Fixed by #2056
Assignees
Labels
analytics App event tracking, instrumentation, logging: Metabase, Amplitude back-end Django views, sessions, middleware, models, migrations etc.

Comments

@thekaveman
Copy link
Member

thekaveman commented Apr 17, 2024

We are proposing to use UTM codes in query strings for various Benefits outreach campaigns. Read more about UTM codes in this article from Hubspot: https://blog.hubspot.com/marketing/what-are-utm-tracking-codes-ht

We need to implement these properties into the Amplitude analytics tracking to be able to later gauge campaign effectiveness.

The proposal is to add them as event_properties and user_properties in the viewed page event. This is likely the first event that a user following a tracked URL will generate. And having the properties on both the event and the user makes later analysis in Amplitude more flexible.

Acceptance Criteria

  • The viewed page event is modified to capture UTM code information
  • Custom event_properties are added for each of the UTM codes:
    • utm_campaign
    • utm_source
    • utm_medium
    • utm_content
    • utm_id
  • Custom user_properties are added for each of the UTM codes:
    • utm_campaign
    • utm_source
    • utm_medium
    • utm_content
    • utm_id

Additional context

UTM code information comes from the query string, accessible via the Django request.GET attribute, an instance of QueryDict.

@thekaveman thekaveman added back-end Django views, sessions, middleware, models, migrations etc. analytics App event tracking, instrumentation, logging: Metabase, Amplitude labels Apr 17, 2024
@indexing
Copy link
Member

indexing commented Apr 25, 2024

@thekaveman I've defined the parameters for our campaign tracking URLs below. Please review and let me know if you note any issues, as we will share these with MST for them to share with Transit.

Tracking URLs for Transit App Campaign

Older adults

Parameter Value
base URL https://benefits.calitp.org
utm_source transitapp
utm_campaign mst_benefits
utm_medium banner
utm_content olderadults_EN
utm_id may2024

Parameter Value
base URL https://benefits.calitp.org
utm_source transitapp
utm_campaign mst_benefits
utm_medium banner
utm_content olderadults_SP
utm_id may2024

Veterans

Parameter Value
base URL https://benefits.calitp.org
utm_source transitapp
utm_campaign mst_benefits
utm_medium banner
utm_content veterans_EN
utm_id may2024

Parameter Value
base URL https://benefits.calitp.org
utm_source transitapp
utm_campaign mst_benefits
utm_medium banner
utm_content veterans_SP
utm_id may2024

@thekaveman
Copy link
Member Author

@indexing these all look good! I think my only note is the field utm_id should be utm_term -- utm_id isn't one of the standard fields.

Note that our implementation here does not depend on the specific values we choose for this TransitApp banner campaign. But we do need to align on the field names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analytics App event tracking, instrumentation, logging: Metabase, Amplitude back-end Django views, sessions, middleware, models, migrations etc.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants