Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix telemetry method and object strings (#6905)
* Fix telemetry method and object strings * De-dupe collection data * Quote hctEnabled Co-Authored-By: muffinresearch <scolville@mozilla.com> * Improve running instructions Co-Authored-By: muffinresearch <scolville@mozilla.com> * Capitalize open Co-Authored-By: muffinresearch <scolville@mozilla.com> * Add colon Co-Authored-By: muffinresearch <scolville@mozilla.com> * Capitalize "open" Co-Authored-By: muffinresearch <scolville@mozilla.com> * Clarify which dev Co-Authored-By: muffinresearch <scolville@mozilla.com> * Use it.each for hct string checks * Add tests for constant mapping
- Loading branch information
1 parent
2271ce1
commit 2e7ad5a
Showing
11 changed files
with
2,201 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
trackingEnabled: false, | ||
loggingLevel: 'debug', | ||
// This requires further manual configuration to collect data. | ||
// Please see docs/telemetry.md for more info. | ||
hctEnabled: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Hybrid Content Telemetry | ||
|
||
Telemetry is being introduced to the discovery pane to replace Google Analytics. | ||
|
||
The following events are logged to telemetry if: | ||
|
||
- HCT is enabled for the host | ||
- Telemetry collection is allowed by the end-user. | ||
|
||
| Category | Method | Action | Value | This is logged when... | | ||
| ----------------- | ----------------- | ------------------------- | ------------------- | --------------------------------------- | | ||
| disco.interaction | addon_click | [addon/theme/statictheme] | [Add-on name] | An add-on link is clicked | | ||
| disco.interaction | download_failed | [addon/theme/statictheme] | [Add-on name] | The download of an extension has failed | | ||
| disco.interaction | enabled | [addon/theme/statictheme] | [Add-on name] | Add-on is enabled | | ||
| disco.interaction | installed | [addon/theme/statictheme] | [Add-on name] | Add-on is installed | | ||
| disco.interaction | install_cancelled | [addon/theme/statictheme] | [Add-on name] | Add-on install is cancelled | | ||
| disco.interaction | install_started | [addon/theme/statictheme] | [Add-on name] | Add-on install has started | | ||
| disco.interaction | uninstalled | [addon/theme/statictheme] | [Add-on name] | Add-on uninstalled | | ||
| disco.interaction | navigation_click | click | [Click description] | When user clicks "Find more Add-ons" | | ||
|
||
## Testing in your local development environment | ||
|
||
Here are the steps to test collection locally: | ||
|
||
- `hctEnabled` is set to `true` by default in `config/development-disco.js`. | ||
- Run `yarn disco:https` to start the disco app because HCT requires HTTPS. | ||
- Go to `about:config` and enable `devtools.chrome.enabled` so that the browser console has the CLI enabled. | ||
- Open the Browser Console (and not the classic devtools) and type: | ||
```javascript | ||
const hostURI = Services.io.newURI('https://example.com:3000'); | ||
Services.perms.add(hostURI, 'hc_telemetry', Services.perms.ALLOW_ACTION); | ||
``` | ||
|
||
## Testing on -dev (hosted environment) | ||
|
||
You'll need to enable installs from -dev before enabling collection. You can skip this step if it's already been done. | ||
|
||
**NOTE: It's recommended you do these settings changes in a new profile as changing to the -dev cert will mark all existing add-ons as invalid.** | ||
|
||
- Right click in `about:config`, select `new` and then add `xpinstall.signatures.dev-root` as `Boolean`. It should be `true`. | ||
- Right click in `about:config`, select `new` and add `extensions.webapi.testing` as `Boolean`. It should be `true`. | ||
- Restart the browser. | ||
|
||
Now enable collection on -dev: | ||
|
||
- Open the Browser Console (and not the classic devtools) and type: | ||
```javascript | ||
const hostURI = Services.io.newURI( | ||
'https://discovery.addons-dev.allizom.org', | ||
); | ||
Services.perms.add(hostURI, 'hc_telemetry', Services.perms.ALLOW_ACTION); | ||
``` | ||
|
||
## Viewing data collected | ||
|
||
- Navigate to `about:telemetry#events-tab` and select the `dynamic` filter (top-right dropdown) | ||
|
||
If there's no data shown, interact with the disco pane and refresh the page (you will need to reselect dynamic) in the filter. | ||
|
||
Here's the [link to the -dev disco pane](https://discovery.addons-dev.allizom.org/en-US/firefox/discovery/pane/57.0/Darwin/normal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.