Skip to content

Commit

Permalink
Add firefox channel to audiences fixes mozilla#60
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlockhart committed Jul 14, 2020
1 parent 3363a39 commit f8c35d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
18 changes: 14 additions & 4 deletions data/Audiences.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import { Audience } from "../types/targeting";

const audiences : {[id: string] : Audience } = {
const CHANNEL_NIGHTLY = "Nightly"
const CHANNEL_BETA = "Beta"
const CHANNEL_RELEASE = "Release"



const audiences: { [id: string]: Audience } = {
all_english: {
name: "All English users (release)",
description: "All users in en-* locales using the release channel.",
targeting: "localeLanguageCode == 'en' && browserSettings.update.channel == 'release'",
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND normalized_channel = 'release'"
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND normalized_channel = 'release'",
firefox_channel: CHANNEL_RELEASE,
},
us_only: {
name: "US users (en; release)",
description: "All users in the US with an en-* locale using the release channel.",
targeting: "localeLanguageCode == 'en' && region == 'US' && browserSettings.update.channel == 'release'",
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND normalized_country_code = 'US' AND normalized_channel = 'release'"
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND normalized_country_code = 'US' AND normalized_channel = 'release'",
firefox_channel: CHANNEL_RELEASE,
},
first_run: {
name: "First start-up users (en; release)",
description: "First start-up users (e.g. for about:welcome) with an en-* locale using the release channel.",
targeting: "localeLanguageCode == 'en' && (isFirstStartup || currentExperiment.slug in activeExperiments) && browserSettings.update.channel == 'release'",
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND payload.info.profile_subsession_counter = 1 AND normalized_channel = 'release'"
desktop_telemetry: "STARTS_WITH(environment.settings.locale, 'en') AND payload.info.profile_subsession_counter = 1 AND normalized_channel = 'release'",
firefox_channel: CHANNEL_RELEASE,

}
};

Expand Down
23 changes: 12 additions & 11 deletions types/targeting.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
export interface Audience {
name: string;
description: string;
targeting?: string;
filter_expression?: string;
/**
* A boolean BigQuery SQL expression expressing whether a single row in telemetry.main would have
* matched the audience definition. These are used for sizing experiment populations,
* not for targeting.
*/
desktop_telemetry?: string;
}
name: string;
description: string;
targeting?: string;
filter_expression?: string;
/**
* A boolean BigQuery SQL expression expressing whether a single row in telemetry.main would have
* matched the audience definition. These are used for sizing experiment populations,
* not for targeting.
*/
desktop_telemetry?: string;
firefox_channel?: string;
}

0 comments on commit f8c35d9

Please sign in to comment.