Skip to content

Add source parameter to external service links #11160

@nfmohit

Description

@nfmohit

Feature Description

All links to external Google services in Site Kit should have a utm_source parameter added, similar to the one done for Reader Revenue Manager.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Any navigation to external Google services from Site Kit should include a utm_source query parameter with sitekit as the value.

Implementation Brief

  • In assets/js/googlesitekit/datastore/user/user-info.js:
    • Update the getAccountChooserURL selector:
      • Before returning the final URL, use addQueryArg to add a utm_source query parameter with sitekit as the value to the destinationURL.
      • In the URL finally returned, add an additional utm_source query parameter with sitekit as the value.
  • In assets/js/modules/pagespeed-insights/datastore/service.js:
    • Update the getServiceURL selector to include a utm_source query parameter with sitekit as the value. Use getServiceURL in assets/js/modules/reader-revenue-manager/datastore/service.js as an example.

Test Coverage

  • In assets/js/googlesitekit/datastore/user/user-info.test.js:
    • Update test coverage for getAccountChooserURL to verify that the utm_source parameter exists in both wrapped and wrapper URLs.
  • In assets/js/modules/pagespeed-insights/datastore/service.test.js:
    • Update test coverage for getServiceURL to verify that the utm_source parameter exists.
  • Fix any other failing test.

QA Brief

  • When navigating to any external service from Site Kit, verify that the resulting URL includes utm_source=sitekit as a query parameter.
  • Some usual locations where such navigation occurs are:
    • The source URLs in the SK dashboard widgets.
    • "See full details in {service}" URLs in SK settings.

Changelog entry

  • Add utm_source=sitekit query parameter to all external service links for source tracking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam MIssues for Squad 2Type: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions