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

Social Share buttons: add UTM campaign codes to shared URLs #8727

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

paulhyland
Copy link

@paulhyland paulhyland commented Jan 27, 2025

This PR adds UTM campaign code query string parameters to URLs shared by social share button links. These parameters follow CFPB guidelines for such campaign codes.


Additions

  • facebook_campaign etc: URL encoded query strings for URLs shared via Facebook, X, LinkedIn, and email.

    note: A value for linkedin_campaign is included here so that the proper query string values are documented, in case LinkedIn restores support for such query strings in shared URLs.

Removals

  • redirect_uri query string parameter in the Facebook share_url (it is no longer needed).

Changes

  • added the new query string parameter strings to the share_url values for each social share button

    note: linkedin_campaign is added to the LinkedIn share_url string, even though it doesn't appear to be supported currently - just in case support for such query strings returns. It does no harm, but rather is simply ignored.

How to test this PR

  1. Go to a page on CF.gov that includes share buttons; these include blog or newsroom posts and some language or report pages.

  2. Click on the Facebook, X (Twitter), and Email share buttons, and confirm that the proper campaign code query strings are added to the links shared via each of these methods.

    Note: If you're testing using localhost:8000, Facebook share won't work, because this platform apparently checks to make sure that the URL you are sharing is reachable.

  3. Click on the LinkedIn share button and make sure that it still works, provides the same share dialog as the live site.

Screenshots

Before After
2629 - Before 2629 - After

Notes and todos

  • If testing using localhost:8000, please loop back to test the share buttons again on the live site and ensure that they are working as expected (see: How to test this PR above).

Checklist

  • PR has an informative and human-readable title
    • PR titles are used to generate the change log in releases; good ones make that easier to scan.
    • Consider prefixing, e.g., "Mega Menu: fix layout bug", or "Docs: Update Docker installation instructions".
  • Changes are limited to a single goal (no scope creep)
  • Future todos are captured in comments and/or tickets

Browser testing

Check the current browser support cutoff list](https://cfpb.github.io/consumerfinance.gov/browser-support#current-browser-support-metrics) for browsers that are advisable
to prioritize for testing.

Accessibility

  • Keyboard friendly (navigable with tab, space, enter, arrow keys, etc.)
  • Screen reader friendly
  • Does not introduce new errors or warnings in WAVE

Other

  • Is useable without CSS
  • Is useable without JS
  • Does not introduce new lint warnings
  • Flexible from small to large screens

@paulhyland paulhyland marked this pull request as ready for review January 29, 2025 22:26
Copy link
Member

@anselmbradford anselmbradford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

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

Successfully merging this pull request may close these issues.

2 participants