Experiments: Provide countryCode to jsfilter function

NEW
Unassigned

Status

Firefox Health Report
Client: Desktop
P4
normal
3 years ago
2 months ago

People

(Reporter: Felipe, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [measurement:client])

(Reporter)

Description

3 years ago
Sooner or later we will want to run an experiment in specific countries, which will require some sort of solution to do that.

Since bug 1109120, Firefox is now able to figure out that information. But it's not present in the FHR or Telemetry payloads available to the filter function.

If we don't add it, we will end up working around it with less elegant solutions like having the experiment code itself do the checks, and then it will need to deactivate itself, and that will leave an inactive/finished experiment in the Add-ons Manager, etc..

If the information from bug 1109120 is not present, it could fall back to the locale code.

Comment 1

3 years ago
Is this available synchronously? Currently that function runs synchronously on the main thread, so async APIs would be a problem.

Also, why isn't that code recorded in FHR/telemetry? We really ought to be validating that our client-side understanding of the code matches the current FHR server-side data.
(Reporter)

Comment 2

3 years ago
_runFilterFunction is async, so it wouldn't be a problem. But in any case, the geoIP request caches the countryCode result in a pref, and I was thinking of just grabbing the pref value if available, or otherwise let it go/fallback to locale if not yet available.

I don't know why that value is not recorded.. probably because no one asked for it to be recorded yet
Did this actually come up as a use-case or can we close this bug?
Flags: needinfo?(felipc)
Priority: -- → P4
Whiteboard: [measurement:client]
(Reporter)

Comment 4

2 years ago
Hm I think at the time there was plans to release some experiments that needed that, but the requirements were changed so it wasn't actually necessary.
I think this would be nice to have, but it has never came up as a use-case again. If you prefer to close the bug for now, feel free.
Flags: needinfo?(felipc)

Comment 5

2 years ago
This is a frequently-requested experiment feature, now that Firefox knows its country code. It should be in the backlog of work.
You need to log in before you can comment on or make changes to this bug.