Add tracking of inbound traffic from browser extension/code host integration
Created by: erzhtor
Part 1 of https://github.com/sourcegraph/sourcegraph/issues/27082:
- Add a method of tracking to link created by the extension to Sourcegraph instances
- Add an event log to record an inbound link from the browser extension
- Ensure this event is present in Amplitude
Description
This PR:
- Adds (previously lacking) UTM markers to browser extension hover links
- Adds event log for browser extension UTM markers on web
This PR completes the following items from the issue above:
How to test
- Browser extenion
- Run bext:
sg run bext
- Check that all links from browser extention to sourcegraph web have UTM markers
-
NOTE: UTM markers on hover links are added dynamically when clicking
-
NOTE: UTM markers are quickly trimmed on web after
- Run bext:
- Web event logging
- Start sourcegraph web:
sg start web-standalone
- Enable event log debugging:
localStorage.setItem('eventLogDebug', true)
- Open for example https://sourcegraph.test:3443/search?utm_source=chrome-extension
- Check DevTools console that
UTMCodeHostIntegration
was logged w/ UTM props as argument and public_argument
- Start sourcegraph web: