Expand UTM allowlists for paid LinkedIn + email campaigns#38
Merged
Conversation
Adds the values needed to track three classes of campaigns that the marketing stack runs today but couldn't accurately attribute through Librarian: - Paid LinkedIn: PaidSocial, CPC mediums; LinkedIn-TLA, LinkedIn-Roadmap-Test campaigns. Unblocks an in-flight Thought Leader Ad test promoting the Roadmap service. - HubSpot broadcasts: HubSpot source; Email medium; Rails-Upgrade-Guide and Re-engagement campaigns. Today these are tagged Organic which lumps them under organic social traffic in GA4. - ConvertKit newsletter: Newsletter medium and Newsletter campaign so recurring sends are separable from one-off broadcasts. A note on naming: existing campaign values are single-word PascalCase (Upgraderuby, Blogpromo). The new values are hyphenated (LinkedIn-TLA, Rails-Upgrade-Guide, Re-engagement) because most new campaigns will be multi- word and hyphens read better in analytics dashboards. Happy to switch them to the existing single-word style if you'd prefer (LinkedinTla, RailsUpgradeGuide, Reengagement). Tests follow the same pattern as the Bluesky utm_source case added in #37. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands
UTM_SOURCES,UTM_MEDIUMS, andUTM_CAMPAIGNso paid LinkedIn ads and HubSpot/ConvertKit email broadcasts can be tracked through Librarian with accurate attribution. Today those campaigns either 422 on share creation or get lumped underutm_medium=Organic.New values
UTM_SOURCESHubSpotUTM_MEDIUMSCPC,Email,Newsletter,PaidSocialUTM_CAMPAIGNLinkedIn-Roadmap-Test,LinkedIn-TLA,Newsletter,Rails-Upgrade-Guide,Re-engagementWhy these specifically
PaidSocial+CPCmediums, plusLinkedIn-TLAandLinkedIn-Roadmap-Testcampaigns. Unblocks an in-flight Thought Leader Ad test promoting the Roadmap service against a matched-audiences company list.HubSpotsource +Emailmedium, plusRails-Upgrade-Guide(for list 187 sends) andRe-engagement(lapsed-subscriber sequences).Newslettermedium andNewslettercampaign so recurring sends are separable from one-off broadcasts.Naming style question
Existing campaign values are single-word PascalCase (
Upgraderuby,Blogpromo). The new values are hyphenated (LinkedIn-TLA,Rails-Upgrade-Guide,Re-engagement) because most new campaigns will be multi-word and hyphens read better in analytics dashboards. Happy to switch them to single-word style (LinkedinTla,RailsUpgradeGuide,Reengagement) if you'd rather keep the existing convention strictly.Tests
Six new specs follow the same pattern as the Bluesky
utm_sourcecase added in #37. One per new value across mediums, campaigns, and theHubSpotsource.bundle exec rspec spec/models/share_spec.rb-> 17 examples, 0 failures.Test plan
POST /links/:id/shares.jsonwithutm_medium=PaidSocial&utm_campaign=LinkedIn-TLAnow returns 201 instead of 422🤖 Generated with Claude Code