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

When linking to LH docs, include utm parameters for analytics #4663

Closed
rviscomi opened this issue Mar 1, 2018 · 5 comments
Closed

When linking to LH docs, include utm parameters for analytics #4663

rviscomi opened this issue Mar 1, 2018 · 5 comments

Comments

@rviscomi
Copy link
Member

rviscomi commented Mar 1, 2018

Right now when we link to the LH docs we don't include any tracking information. For example:

https://developers.google.com/web/tools/lighthouse/audits/has-viewport-meta-tag

We could include utm parameters to better understand how visitors arrived at the docs and why. For example:

https://developers.google.com/web/tools/lighthouse/audits/has-viewport-meta-tag?utm_source=lighthouse&utm_medium=extension&utm_content=failure

Ideally we'd use utm_medium to differentiate the Chrome extension from the Audits panel in Dev Tools. Not sure if the code is self-aware enough to make this distinction.

Other params: utm_source always lighthouse to indicate that we sent users there from this tool, and utm_content to identify why users were sent to the docs (the audit failed, passed, maybe specific details about the failure reason).

cc @paulirish @patrickhulce @kaycebasques

@kaycebasques
Copy link
Contributor

kaycebasques commented Mar 2, 2018

utm_content=failure would be very helpful data.

@kdzwinel
Copy link
Collaborator

kdzwinel commented Mar 26, 2018

@paulirish regarding utm_medium - I haven't found any existing code that recognizes the environment (I thought that maybe sentry code is doing that, but sentry only works in cli). How does this look in your opinion:

function getEnvironment() {
  if (typeof window !== 'undefined') {
    if (typeof InspectorMain !== 'undefined') {
      return 'devtools';
    }
    return 'extension';
  }
  return 'cli';
}

[Edit] utm_source -> utm_medium

@rviscomi
Copy link
Member Author

^ small correction: utm_source should always be lighthouse, but we should customize the utm_medium param to match the environment

@kdzwinel
Copy link
Collaborator

As discussed on the eng meeting - we are going to include environment info in the build time (instead of detecting it in the runtime as I originally proposed).

@brendankenny
Copy link
Member

#4972 was well suited to things before we changed the whole build system.

The changes broke the PR pretty badly, but hopefully made it simpler to accomplish the same task. There's a separate entry point for the extension/DevTools/LR/CLI now as well as a separate build entry point for each, which means we can easily add something to each platform's call out to the report generator (or add a process.env variable if it really comes down to it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants