Bug 1874051 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Following on the work in bug 1874047, here we want to adjust the targeting and frequency of the 3 callouts, independent of their contents.

## Product and Design specs

For background, here's the product experiment brief google doc for this work: https://docs.google.com/document/d/11cP_XbmPbPagyJepebaTstEuPl_inYeKFPecNN3Wu-0/edit

The designs are in the "Final" screen of [this figma](https://www.figma.com/file/JhKhHqJJ9bjzU1TITUpiWi/Review-Checker---Experiments?type=design&node-id=662-25257&mode=design&t=nw2H21IjJtOEyR2J-0)

I've attached screenshots of the 3 callout updates, since bugs tend to outlive design tools.

## Tweaking the targeting and frequency

The targeting is mostly driven by state stored in prefs. You can find the targeting definitions in the asrouter devtools, or here in the source code: https://searchfox.org/mozilla-central/source/browser/components/newtab/lib/FeatureCalloutMessages.sys.mjs#630

I'm not sure the asrouter devtools will help us with testing here; we'll instead want to simulate remotely adding callouts, by appending a list of new callouts to the tail end of FeatureCalloutMessages.sys.mjs. Because there's an existing set of callouts in tree, we'll need to null those out by adding new no-op callouts with the same callout ID as the existing callouts, and a higher priority value, something roughly like:

```
// stuff to add to the FeatureCalloutMessages.sys.mjs file for local testing
[
    {
      // Blank out all other callouts
      "priority": 2,
      "trigger": {
        "id": "shoppingProductPageWithSidebarClosed"
      },
      "targeting": "true"
    },
    {
      // New callout 1
      "id": "SHOPPING_CALLOUT_1:A",
      "priority": 3
      // ...
    },
  // ... add the other new callouts ...
]
```
Following on the work in bug 1874047, here we want to adjust the targeting and frequency of the 3 callouts, independent of their contents.

## Product and Design specs

For background, here's the product experiment brief google doc for this work: https://docs.google.com/document/d/11cP_XbmPbPagyJepebaTstEuPl_inYeKFPecNN3Wu-0/edit

The designs are in the "Final" screen of [this figma](https://www.figma.com/file/JhKhHqJJ9bjzU1TITUpiWi/Review-Checker---Experiments?type=design&node-id=662-25257&mode=design&t=nw2H21IjJtOEyR2J-0)

I've attached screenshots of the 3 callout updates, since bugs tend to outlive design tools.

## Tweaking the targeting and frequency

The targeting is mostly driven by state stored in prefs. You can find the targeting definitions for our callouts in the asrouter devtools, or here in the source code: https://searchfox.org/mozilla-central/source/browser/components/newtab/lib/FeatureCalloutMessages.sys.mjs#630

The source docs cover [targeting expressions](https://firefox-source-docs.mozilla.org/browser/components/newtab/content-src/asrouter/docs/targeting-guide.html) and [available targeting attributes](https://firefox-source-docs.mozilla.org/browser/components/newtab/content-src/asrouter/docs/targeting-attributes.html), although I don't think we'll need to change the targeting attributes here.

I'm not sure if we can use the asrouter devtools to help us with testing here, because we need to override the existing callouts; I think we'll instead want to simulate remotely adding callouts, by appending a list of new callouts to the tail end of FeatureCalloutMessages.sys.mjs. Because there's an existing set of callouts in tree, we'll need to null those out by adding new no-op callouts with the same callout ID as the existing callouts, and a higher priority value, something roughly like:

```
// stuff to add to the FeatureCalloutMessages.sys.mjs file for local testing
[
    {
      // Blank out all other callouts
      "priority": 2,
      "trigger": {
        "id": "shoppingProductPageWithSidebarClosed"
      },
      "targeting": "true"
    },
    {
      // New callout 1
      "id": "SHOPPING_CALLOUT_1:A",
      "priority": 3
      // ...
    },
  // ... add the other new callouts ...
]
```

As with the other bug, we're not landing this in tree, so I'm not sure of the best way to get feedback and call this done. Maybe "code review" in a google doc, and drop the final working info in a comment when you close the bug?

Back to Bug 1874051 Comment 0