Enable MAC counting with eyeometry in AdBlock
Background
eyeometry for MAC counting was implemented in the Engine a while ago but so far it has not been enabled in AdBlock. We rely on eyeometry for CDP and there is a desire to unify the MAC counting mechanics and use eyeometry for all products in the the future.
What to do
Update AdBlock
- Add support for the retrieving of environment variables during the build so that the eyeometry URL and token are not hard-coded
- Retrieve the new environment variables, and pass them to the
ewe.start
function (including checking the user preference "data_collection_opt_out") - Since there doesn't appear to be a function to update the status of the data collection state with in the extension engine, when a user opts out of data collection, the change will be delayed until the browser or extension is restarted.
Relevant links
Related Jira Ticket
Hints for testers
Use the extension built on the CI pipelines "build" step for testing Eyeometry functionality. It has the production Eyeometry credentials built in, provided using Gitlab CI's secrets.
Things to test:
- Eyeometry will send a single POST request on the first start to the specified telemetry URL, using the specified bearer token for authentication, with metadata about the extension. The telemetry server is only pinged once.
- "Opt-out of all data collection in the AdBlock extension." setting.
- Firefox optout gets set to true by default.
- Chrome optout gets set to false by default.
Other expected behaviour:
- Using a local build without the
.env
file will not trigger any Eyeometry-related requests and should still build and run/function normally. - The build from the pipelines (The one that should be tested and submitted to the web stores) should trigger eyeometry requests.
Other context:
- Watching the "Network" tab on the background page/service worker dev tools can be useful, to see the ping to the eyeometry server. We expect to see only one ping after installation.
Edited by Brent M