Metrics
In product metrics
The locations and interaction moments where events will be collected for use in Sourcegraph’s product analytics tools often must be defined within design artifacts.
To define a metric, designers should use a metric card from the project tools library. These cards help standardize the names and description of metrics across the product.
Follow the guidelines for naming events when defining an event.
- If a large number of events are being collected, consider creating a Metrics page in Figma (example) to identify the locations and interactions where events will be collected.
- Metrics review: consider requesting a review of your metrics definitions from the analytics team before the project goes to development.
Tracking events across domains or products
Often we need to understand how our designs perform when they send traffic to Sourcegraph websites outside of the product we are working on. When these events occur and end at a publicly facing Sourcegraph website, we can use Google Analytics UTM parameters to track the source of the event.
Examples of scenarios you may need to track:
- Sign-up links from an IDE extension to Sourcegraph.com
- Links from Sourcegraph.com to a lead generation form on about.sourcegraph.com
- Links from Server to Sourcegraph.com
Examples of events you cannot track with UTM parameters:
- Links from an IDE extension to a Server installation of Sourcegraph (use Pings to track this)
- Links from Sourcegraph.com to external properties like Youtube videos (use event logs to track the outbound click)
How Sourcegraph uses UTM parameters:
- utm_campaign={STRING} A string describing a series of content you are using to promote the link.
- utm_medium=direct-traffic It is important this value be set as so
- utm_source={STRING} Typically ‘in-product’, potentially with a product designator. Potential values:
- inproduct: links from the Sourcegraph applicaiton
- vsce: links from the VS Code extension
- bext: links from the Browser extension
- utm_content={STRING} A descriptor for the content used in the link
This can all be a little daunting, and it’s hard to know how to name your values for these parameters. The UTM tracking spreadsheet will help you create the link and allow review existing in-product links to use as a guide.
After filling out a new row in the UTM tracking spreadsheet, create a UTM card component with the value in the last column and inform your engineer of the requirement.
UTM parameters work on the following websites:
- docs.sourcegraph.com
- about.sourcegraph.com
- sourcegraph.com
- learn.sourcegraph.com
To develop reporting for these links, log into Google Analytics and use the Campaigns > All campaigns feature of the application.