Commit Graph

57 Commits

Author SHA1 Message Date
James Teow
eb569539c3 Bug 1909979 - Add ad_popover to components found on SERPs and add the ability to ignore sponsored links - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D217999
2024-08-07 18:30:19 +00:00
James Teow
419db13c99 Bug 1907097 - Add telemetry for when ads_blocked are counted - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D216208
2024-07-16 07:16:42 +00:00
James Teow
0482ed1f22 Bug 1906945 - Switch to using checkVisibility in child process - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D216082
2024-07-10 19:51:16 +00:00
James Teow
59fcaf5a0a Bug 1905095 - Loosen the heuristic for ads_visible - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D215283
2024-07-08 14:57:13 +00:00
James Teow
cfe7e470ff Bug 1851907 - Remove SERP Telemetry v1 feature gating pref - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D207947
2024-05-01 17:41:04 +00:00
Stephanie Cunnane
4c9a2ed714 Bug 1887943 - Refine textContent domain extraction method. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D205928
2024-04-02 16:08:19 +00:00
Stephanie Cunnane
c628d16a82 Bug 1846367 - Extract domains from text content if other methods won't work. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D204420
2024-03-14 22:53:34 +00:00
Mark Banner
afdbce2ec3 Bug 1884623 - Update more jsm references in production code and docs in browser/. r=mossop,extension-reviewers,omc-reviewers,migration-reviewers,robwu,mconley,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D204182
2024-03-11 15:26:28 +00:00
James Teow
eea7373fb2 Bug 1884219 - Don't extract hrefs from elements if it contains Javascript - r=scunnane
The extractHrefs method is used to retrieve hrefs from components before passing it
SearchSERPTelemetry to store for future use when observer activity in the network process.
Javascript URLs are uncommon but can accidentally be extracted, especially if a topDown
search for elements is used. No test is added because the presence of the element in an
categorized component will break existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D203957
2024-03-08 11:26:48 +00:00
James Teow
f83afd1a47 Bug 1883811 - Move domain processing into child process - r=scunnane
Fundamentally, there shouldn't be any differences in functionality. I removed the
unit test since it was covered by the browser test and added a couple scenarios.

Differential Revision: https://phabricator.services.mozilla.com/D203706
2024-03-07 15:39:52 +00:00
James Teow
857c9a1a5f Bug 1879341 - Part 3: Move callers of #addEventListenerToElements to use new helper - r=scunnane
When enough users have transitioned to this version, we can update search-telemetry-v2 that
uses the new topDown features, and can delete the old interface.

Differential Revision: https://phabricator.services.mozilla.com/D202039
2024-02-27 01:43:58 +00:00
James Teow
c2342aafcc Bug 1879341 - Part 2: Provide a way for conditions to be checked when an event is registered - r=scunnane
To allow the use of strings in Remote Settings to add conditions to the events, we pass expressions
that will be evaluated by the FilterExpression component. We pass the event details and some of
the params of the function that might be useful in the future.

Differential Revision: https://phabricator.services.mozilla.com/D202038
2024-02-27 01:43:58 +00:00
James Teow
f4acf2aa44 Bug 1879341 - Part 1: Allow parent and child selectors to add event listeners - r=scunnane
Previously, the only the way elements could add event listeners was using the related keyword.
This is too limiting, so this will allow parent and child elements to use the eventListeners
array to list events they want to listen for, the action that should be reported, and the target.
If no target is provided, the component type will be used. If no action is provided and the
event is click, the default action, clicked, will be used.

Differential Revision: https://phabricator.services.mozilla.com/D202037
2024-02-27 01:43:57 +00:00
James Teow
512aa69979 Bug 1880410 - Clean up parts of search telemetry - r=scunnane
Largely non-functional changes:
- The pagehide callback can live in the top level pagehide event.
- Moving the submitted check into the callback will make it easier to refactor
  the helper that adds event listeners.
- Changing the callbacks to use target as the name will make it easier to
  remember that the target is potentially overwritable.
- waitForPageWithAction can be used in future tests.

Differential Revision: https://phabricator.services.mozilla.com/D202036
2024-02-23 17:16:14 +00:00
James Teow
50464e46c4 Bug 1880409 - Allow searching for DOM elements without reporting their count to the ad_impression metric - r=scunnane
Adds a flag that allows top down searches for elements to not report the number found back
to the ad_impression event. In later patches, this will allow us to add event listeners to
elements separately from other queries that might better answer the number of components
on the page. Additionally, we may want to add event listeners without reporting the
element in ad_impression, e.g. search boxes.

Differential Revision: https://phabricator.services.mozilla.com/D202035
2024-02-23 17:16:13 +00:00
James Teow
99fdf1db06 Bug 1879737 - Extract domain from query param values containing hrefs - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D201626
2024-02-14 02:55:55 +00:00
James Teow
7175b5f2b9 Bug 1879404 - Only record a submit event on SPA's when a new search occurs - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D201159
2024-02-13 20:14:46 +00:00
James Teow
8c241cb504 Bug 1878062 - Check for a possible content process event before manually registering an engagement event - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D200405
2024-02-07 12:58:25 +00:00
James Teow
45c16fd91e Bug 1864214 - Observe actions on single page application search engine providers - r=Standard8
updateTrackingSinglePageApp() contains the core logic for when we observe same document loads.
Based on conditions, it may record telemetry (engagement/abandonment), and dispatch events
to the appropriate SearchSERPTelemetry actor.

SearchSERPTelemetryChild had to be modified to allow for manual dispatching of events, especially
unloading event listeners in the case where a user navigates to a non-default search page, like
Images or Shopping.

One complication in observing clicks is we're storing search pages based on the URL at the time
of load, and then looking them up again using the originURL, but it might be different from
the currentURL due to the way single page apps work. So this could cause confusion if multiple SERPs
are open and different from their originURL, hence the usage of recovering the correct state map by
first using the browser object and defaulting back to the originURL if the WeakMap doesn't
contain any of the browser objects.

I also created a mock SPA html file that when given a search query parameter, shows mock results.
The helper file head-spa.js contains a class that navigates the pages in tests.

The tests are broken out into the following:
- When a single search provider is opened in a single tab
- When a single search provider is has multiple tabs open
- When multiple providers are open at the same time
- Event listeners on in-content elements are unloaded properly when navigating away from the page

Differential Revision: https://phabricator.services.mozilla.com/D193320
2024-01-31 12:51:54 +00:00
Stanca Serban
c109e5d34d Backed out changeset 716bfac5741b (bug 1864214) foir causing webrender debug leakcheck failures. CLOSED TREE 2024-01-29 21:41:29 +02:00
James Teow
a461777d68 Bug 1864214 - Observe actions on single page application search engine providers - r=Standard8
updateTrackingSinglePageApp() contains the core logic for when we observe same document loads.
Based on conditions, it may record telemetry (engagement/abandonment), and dispatch events
to the appropriate SearchSERPTelemetry actor.

SearchSERPTelemetryChild had to be modified to allow for manual dispatching of events, especially
unloading event listeners in the case where a user navigates to a non-default search page, like
Images or Shopping.

One complication in observing clicks is we're storing search pages based on the URL at the time
of load, and then looking them up again using the originURL, but it might be different from
the currentURL due to the way single page apps work. So this could cause confusion if multiple SERPs
are open and different from their originURL, hence the usage of recovering the correct state map by
first using the browser object and defaulting back to the originURL if the WeakMap doesn't
contain any of the browser objects.

I also created a mock SPA html file that when given a search query parameter, shows mock results.
The helper file head-spa.js contains a class that navigates the pages in tests.

The tests are broken out into the following:
- When a single search provider is opened in a single tab
- When a single search provider is has multiple tabs open
- When multiple providers are open at the same time
- Event listeners on in-content elements are unloaded properly when navigating away from the page

Differential Revision: https://phabricator.services.mozilla.com/D193320
2024-01-29 15:04:51 +00:00
James Teow
0853e415e9 Bug 1785104 - Update consumers of search-telemetry-v2 when it is updated - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D192482
2023-11-13 14:43:53 +00:00
Mark Banner
89ef560a9e Bug 1861676 - Use the new queryParamNames SERP telemetry parameter by default. r=search-reviewers,jteow
Differential Revision: https://phabricator.services.mozilla.com/D191649
2023-11-03 10:35:04 +00:00
Cosmin Sabou
40136d94be Backed out changeset eb4c4b32c59b (bug 1861676) for failures on browser_urlbar_telemetry.js. 2023-11-03 01:49:21 +02:00
Mark Banner
3e1df69ce4 Bug 1861676 - Use the new queryParamNames SERP telemetry parameter by default. r=search-reviewers,jteow
Differential Revision: https://phabricator.services.mozilla.com/D191649
2023-11-02 21:02:01 +00:00
James Teow
69b07fd670 Bug 1842554 - Enable SERP Telemetry improvements - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D186552
2023-09-07 10:18:43 +00:00
Stephanie Cunnane
1c5fdd13a5 Bug 1846357 - Extract domains for basic SERP links. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D185609
2023-09-05 16:49:53 +00:00
James Teow
cff6acbaba Bug 1833495 - Check if an ad is well above the possible viewable window - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D181179
2023-06-19 14:03:16 +00:00
James Teow
2b884da379 Bug 1837429 - Rename hasShoppingTab to shoppingTabDisplayed - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D180346
2023-06-08 19:55:51 +00:00
James Teow
adefe13ae5 Bug 1835321 - Allow any link on SERPs that don't match an ad expression to be considered a non-ad - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D179367
2023-06-01 02:13:18 +00:00
James Teow
b3d2e61651 Bug 1834100 - Use timing distribution for categorizing components in SearchSERPTelemetryChild - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D179116
2023-05-31 14:24:34 +00:00
James Teow
2a015a7a12 Bug 1834701 - Refactor SearchSERPTelemetry to have more isolation of page data - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D178911
2023-05-31 14:24:34 +00:00
James Teow
b3ce162411 Bug 1835125 - Check for missing components instead of providerInfo - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D179125
2023-05-26 05:46:01 +00:00
Mark Banner
0666077666 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
James Teow
3eefbb7763 Bug 1833877 - Don't check page for components related to the impression if components don't exist - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D178445
2023-05-19 02:09:57 +00:00
James Teow
38eafa0f05 Bug 1832863 - Use getAttribute instead of href property - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D178052
2023-05-16 22:03:46 +00:00
James Teow
e4efda560d Bug 1832811 - Remove unused features - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D177909
2023-05-16 11:33:33 +00:00
James Teow
6a15d6bf99 Bug 1832868 - Don't cause flushing when checking the dimensions of elements - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D178051
2023-05-15 19:16:27 +00:00
James Teow
402ea6d372 Bug 1832542 - Cache anchor and data-attribute value - r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D177758
2023-05-11 16:18:56 +00:00
James Teow
3f00e836a9 Bug 1831880 - Optionally use shopping tab regular expression in SearchSERPTelemetryChild - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D177451
2023-05-10 16:11:43 +00:00
James Teow
f8aff411e8 Bug 1831876 - Don't attempt to record an impression / ad impression on pages that don't include a search parameter - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D177385
2023-05-09 15:46:57 +00:00
James Teow
5eda9ce4a1 Bug 1830452 - Properly check the existence of child elements from the context of the parent - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D176746
2023-05-02 20:37:11 +00:00
James Teow
4c02a7b6f4 Bug 1829489 - Encode URLs before sending them back to the parent - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D176385
2023-04-28 04:05:13 +00:00
James Teow
a42ff7a75c Bug 1830302 - Move default definition on the same level as the component type - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D176661
2023-04-27 16:19:24 +00:00
James Teow
3d8c8f4f15 Bug 1829712 - Remove DOM element from WeakMap after listeners are removed - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D176337
2023-04-26 12:24:50 +00:00
James Teow
bead9387a2 Bug 1828786 - Allow component categorization and ad_impression to occur on pages without ads - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D176159
2023-04-24 14:54:28 +00:00
James Teow
2ef6f43e88 Bug 1824543 - Add shopping_tab_displayed and is_shopping_page to Impression Event - r=Standard8
Since we rely on the child process to parse this information, we need to
wait until the child has reported the presence of the shopping page
before sending the Impression event.

Differential Revision: https://phabricator.services.mozilla.com/D175576
2023-04-21 21:19:39 +00:00
James Teow
ad969973e6 Bug 1816735 - Add expanded and submitted states - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D175546
2023-04-21 20:22:21 +00:00
James Teow
1e0f3a44da Bug 1816730 - Step 2: Allow targets in content process to register click events - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D175311
2023-04-21 16:54:22 +00:00
James Teow
83116d3c19 Bug 1816730 - Step 1: Add target property for click events that can be detected in network processes - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D175160
2023-04-21 16:54:21 +00:00