### NPM Commands for Extension Development Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/README.md This project utilizes a set of predefined NPM commands for managing the development workflow of the search engine extension. These commands cover tasks such as compiling TypeScript, building the addon, running in developer mode, linting, packaging, testing, and watching for changes. ```shell npm run compile-typescript # Compiles the Typescript source code. The compiled code is saved in the src/ directory. ``` ```shell npm run build # Assembles the final addon. The bundler generated code is saved in the dist/ directory. ``` ```shell npm run dev # Assembles the addon in _developer mode_. Data is dumped to the Browser Console instead of being submitted, allowing for smoother development. ``` ```shell npm run lint # Runs linting on the add-on code. ``` ```shell npm run package # Packages the final archive containing the bundled addon, saved in the web-ext-artifacts directory. ``` ```shell npm run start # Builds the addon and runs a Firefox instance, side-loading the add-on for manual testing or debugging. ``` ```shell npm run test-integration # Performs the provided integration test for the final addon. ``` ```shell npm run watch # Assembles the addon in _developer mode_, runs the browser, and watches the source code for changes, automatically reloading the extension when needed. ``` -------------------------------- ### Study Initialization Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md This section details the metrics collected during the initialization phase of the search engine usage study. It covers boolean flags, timestamps, unique identifiers, and quantitative counts related to user search behavior and study participation. ```APIDOC study_initialization.landing_page_history: Type: boolean Description: If the advertisement landing page is in browser history. Review: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Retention: never study_initialization.ping_time: Type: datetime Description: The time that the data submission ping was generated. Review: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Retention: never study_initialization.survey_id: Type: string Description: A randomly generated unique ID that enables syncing survey data on Qualtrics with other data in the study. Review: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Retention: never study_initialization.yahoo_query_count: Type: quantity Unit: queries Description: The number of unique search queries (the text a user enters into a search engine) to Yahoo! over the past 30 days from browser history. Review: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Retention: never study_initialization.yandex_query_count: Type: quantity Unit: queries Description: The number of unique search queries (the text a user enters into a search engine) to Yandex over the past 30 days from browser history. Review: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Retention: never ``` -------------------------------- ### Study Initialization Ping Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Defines the metrics collected for the study-initialization ping, which is sent when a study first loads. It includes user search query counts for various engines, default search engine, condition type, enrollment time, and browser history age. ```APIDOC study_initialization_ping: description: Ping sent when the study first loads in the participant's web browser. metrics: rally.id: type: uuid description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. data_reviews: Review 1 expiration: never study_initialization.ask_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to Ask.com over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.baidu_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to Baidu over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.bing_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to Bing over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.condition_type: type: string description: The randomly chosen condition group for the participant. data_reviews: Review 1 expiration: never study_initialization.default_search_engine: type: string description: The participant's default search engine in web browser settings. data_reviews: Review 1 expiration: never study_initialization.duckduckgo_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to DuckDuckGo over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.ecosia_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to Ecosia over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.enrollment_time: type: datetime description: The time when the participant joined the study. data_reviews: Review 1 expiration: never study_initialization.google_query_count: type: quantity description: The number of unique search queries (the text a user enters into a search engine) to Google over the past 30 days from browser history. data_reviews: Review 1 extras: unit: queries expiration: never study_initialization.history_age: type: quantity description: How far back the browser's history goes, with a maximum of 30 days. We collect this value to account for participants who have a browser history that is shorter than 30 days. data_reviews: Review 1 extras: unit: milliseconds expiration: never ``` -------------------------------- ### SERP Visit Ping Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Defines the metrics collected for the serp-visit ping, detailing each metric's name, data type, purpose, and any associated units or data review links. This includes client-specific information and details about user interaction with search engine results pages. ```APIDOC Ping: serp-visit Description: This ping is sent when there is a visit to a search engine results page. Metrics: - rally.id: Type: uuid Description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.attention_duration: Type: quantity Description: How long the SERP had the participant's attention. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: milliseconds Expiration: never - serp_visit.attribution: Type: string Description: How the user navigated to the search engine. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.attribution_id: Type: string Description: A randomly generated unique ID that associates related SERPs. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.current_default_engine: Type: string Description: The participant's default search engine at the time of the SERP visit. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.dwell_time: Type: quantity Description: How long the SERP was open in the participant's browser. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: milliseconds Expiration: never - serp_visit.google_results_num: Type: quantity Description: The number of results produced for the query by Google. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: results Expiration: never - serp_visit.modification_type: Type: string Description: The type of modification that the study attempted to make to the self-preferenced results on the search engine response page (None, Removal, Replacement). Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.navigational_query: Type: string Description: If the search query was a navigational query to one of the tracked online services or Google services, then this will be the category of the online service it was for. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Expiration: never - serp_visit.num_ad_clicks: Type: quantity Description: The number of advertisements that the participant clicked on. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: clicks Expiration: never - serp_visit.num_ads: Type: quantity Description: The number of advertisements on the page. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: pages Expiration: never - serp_visit.num_internal_clicks: Type: quantity Description: The number of result links that the participant clicks and that lead to another page operated by the same company as the search engine. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: clicks Expiration: never - serp_visit.num_self_preferenced_clicks: Type: quantity Description: The number of selections of links in the self-preferenced results. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: unit: clicks Expiration: never ``` -------------------------------- ### Glean Metrics for Notice Interaction Ping Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Defines the specific metrics collected for the 'notice-interaction' ping. This ping is sent after a participant completes a default condition treatment, typically by closing a notice window or interacting with its controls. It includes timing information, search engine details, and user actions related to the treatment. ```APIDOC notice_interaction.attention_duration: quantity (milliseconds) - Description: How long the treatment notice had the participant's attention. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.dwell_time: quantity (milliseconds) - Description: How long the treatment notice was open. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.new_search_engine: string - Description: The search engine that the default was changed to. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.old_search_engine: string - Description: The participant's default search engine in web browser settings, before the treatment was applied. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.ping_time: datetime - Description: The time that the data submission ping was generated. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.revert_selected: boolean - Description: Whether the participant selected the revert button. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.treatment_completion_time: datetime - Description: The time that the treatment was completed. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC notice_interaction.treatment_time: datetime - Description: The time that the treatment was applied. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` ```APIDOC rally.id: uuid - Description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. - Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 - Expiration: never ``` -------------------------------- ### Style Input State with CSS Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/public/options.html This CSS snippet demonstrates styling based on an input's checked state. It targets elements with the class '.dot' that are preceded by a checked input element, applying a horizontal translation. This is commonly used for visual feedback or animations in user interfaces. ```css input:checked~.dot { transform: translateX(100%); } ``` -------------------------------- ### SERP Visit Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Metrics related to user visits to Search Engine Results Pages (SERPs). This includes details about organic clicks, page loading status, query information, and search engine specifics. ```APIDOC serp_visit.organic_clicks: type: event description: Details for each selection of an organic result on the SERP. attributes: - attention_duration_upon_click: The attention duration when the selection occurred. - page_loaded_upon_selection: Whether the SERP completed loading when the selection occurred. - result_ranking: The ranking of the selected organic result. serp_visit.organic_details: type: event description: Details for each of the organic results on the SERP. attributes: - result_bottom_height: The number of pixels between the top of the page and the bottom of the organic result. - result_online_service: The online service of the result only if the result is for one of the tracked online services. - result_page_num: The page number that the organic result was on (only collected for DuckDuckGo SERPs). - result_top_height: The number of pixels between the top of the page and the top of the organic result. serp_visit.page_loaded: type: boolean description: Whether the SERP completed loading in the participant's browser. serp_visit.page_number: type: quantity description: The page number of the results for the query. unit: page serp_visit.page_visit_start_time: type: datetime description: The timestamp the SERP visit started rounded down to the nearest hour. serp_visit.ping_time: type: datetime description: The time that the data submission ping was generated. serp_visit.query_hash: type: string description: A salted hash of the search query. serp_visit.query_vertical: type: string description: The category of online content the search query is for. serp_visit.results_num: type: quantity description: The number of results produced for the query by the search engine. unit: results serp_visit.search_area_bottom_height: type: quantity description: The number of pixels between the top of the page and the bottom of the search result area. unit: pixels serp_visit.search_area_top_height: type: quantity description: The number of pixels between the top of the page and the top of the search result area. unit: pixels serp_visit.search_engine: type: string description: Which search engine the user queried. serp_visit.self_preferenced_details: type: event description: Details for each of the tracked self-preferenced results on the SERP. attributes: - result_bottom_height: The number of pixels between the top of the page and the bottom of the self preferenced result. - result_top_height: The number of pixels between the top of the page and the top of the self preferenced result. - self_preferenced_result_type: The type of self-preferenced result (flights, hotels, maps, lyrics, weather, shopping, etc.). ``` -------------------------------- ### Glean Metrics for Search Engine Usage Study Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Defines key metrics collected for the search engine usage study, including time since the same query and the transition type leading to a search results page visit. These metrics are part of the study-enrollment ping. ```APIDOC Metric: serp_visit.time_since_same_query Type: quantity (unit: milliseconds) Description: The time since the participant made the same query to the same search engine. Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Expiration: never Metric: serp_visit.transition Type: string Description: The transition that brought the participant to this particular page. Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Expiration: never ``` -------------------------------- ### CSS Styling for Study Interface Elements Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/src/pages/lotteryPopup.html This CSS defines the visual appearance of elements within the Search Engine Usage Study interface. It includes styles for the main body font, a button container layout, a prominent 'buttonRedeem' with detailed styling for different interaction states, and an 'icon' class for image elements. These styles are crucial for the user experience and presentation of the study's web components. ```css /* May need to add font bundling or revisit the font choice for cross-browser compatibility. */ body { font-family: sans-serif; } .button-container { display: table; border-collapse: separate; border-spacing: 15px; margin: 0 auto; } .buttonRedeem { align-items: center; appearance: none; background-color: #f1f1f1; border-radius: 24px; border-style: none; box-shadow: rgba(0, 0, 0, .2) 0 3px 5px -1px, rgba(0, 0, 0, .14) 0 6px 10px 0, rgba(0, 0, 0, .12) 0 1px 18px 0; box-sizing: border-box; color: #3c4043; cursor: pointer; display: inline-flex; fill: currentcolor; font-family: "Google Sans", Roboto, Arial, sans-serif; font-size: 14px; font-weight: 500; height: 48px; justify-content: center; letter-spacing: .25px; line-height: normal; max-width: 100%; overflow: visible; padding: 2px 24px; position: relative; text-align: center; text-decoration: none; text-transform: none; transition: box-shadow 280ms cubic-bezier(.4, 0, .2, 1), opacity 15ms linear 30ms, transform 270ms cubic-bezier(0, 0, .2, 1) 0ms; user-select: none; -webkit-user-select: none; touch-action: manipulation; width: auto; will-change: transform, opacity; z-index: 0; } .buttonRedeem:hover { background-color: #f6f9fe; } .buttonRedeem:active { box-shadow: 0 4px 4px 0 rgb(60 64 67 / 30%), 0 8px 12px 6px rgb(60 64 67 / 15%); outline: none; } .buttonRedeem:focus { outline: none; border: 2px solid #4285f4; } .buttonRedeem:not(:disabled) { box-shadow: rgba(60, 64, 67, .3) 0 1px 3px 0, rgba(60, 64, 67, .15) 0 4px 8px 3px; } .buttonRedeem:not(:disabled):hover { box-shadow: rgba(60, 64, 67, .3) 0 2px 3px 0, rgba(60, 64, 67, .15) 0 6px 10px 4px; } .buttonRedeem:not(:disabled):focus { box-shadow: rgba(60, 64, 67, .3) 0 1px 3px 0, rgba(60, 64, 67, .15) 0 4px 8px 3px; } .buttonRedeem:not(:disabled):active { box-shadow: rgba(60, 64, 67, .3) 0 4px 4px 0, rgba(60, 64, 67, .15) 0 8px 12px 6px; } .buttonRedeem:disabled { box-shadow: rgba(60, 64, 67, .3) 0 1px 3px 0, rgba(60, 64, 67, .15) 0 4px 8px 3px; } .icon { max-width: 50px; max-height: 50px; float: left; padding-right: 10px; } ``` -------------------------------- ### Glean SDK: Ballot Interaction Ping Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md This ping is sent for users in the search engine ballot treatment group once they've made a selection, or if they have refused to make a selection three times. It collects details about user interactions with the ballot. ```APIDOC Ping: ballot-interaction Description: This ping is sent for users in the search engine ballot treatment group once they've made a selection, or if they have refused to make a selection three times. Metrics: - ballot_interaction.attempt_details (event): Description: Details for each of the ballot attempts. Extras: - attempt_number: What number attempt this was. - attention_duration: How long the presentation of the ballot had the user's attention. - details_expanded: The names of search engines on the ballot for which the participant expanded details (only relevant in Condition 5). - dwell_time: How long the presentation of the ballot was open. - see_more_selected: If the user clicked the “See More Search Engines” button (only relevant in Condition 7). - treatment_time: The time that the ballot was presented to the participant. Data Reviews: Review 1 Expiration: never - ballot_interaction.attempts (quantity): Description: The number of times that a choice ballot was presented to the participant. If a selection is not made after 3 attempts, the ballot is not shown again. Extras: - unit: attempts Data Reviews: Review 1 Expiration: never - ballot_interaction.ballot_ordering (string_list): Description: The ordering of the search engines on the ballot. Data Reviews: Review 1 Expiration: never - ballot_interaction.new_search_engine (string): Description: The search engine that the participant selected and the default was changed to. Data Reviews: Review 1 Expiration: never - ballot_interaction.old_search_engine (string): Description: The participant's default search engine in web browser settings, before the treatment was applied. Data Reviews: Review 1 Expiration: never - ballot_interaction.ping_time (datetime): Description: The time that the data submission ping was generated. Data Reviews: Review 1 Expiration: never - ballot_interaction.treatment_completion_time (datetime): Description: The time that the treatment was completed. Data Reviews: Review 1 Expiration: never - rally.id (uuid): Description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. Data Reviews: Review 1 Expiration: never Built-in Metrics: - ping_info - client_info ``` -------------------------------- ### Online Service Navigation Ping Metrics Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Details the metrics collected for the online-service-navigation ping, including timestamps, navigation data aggregation, and client identifiers. This data is used to analyze user behavior on tracked online services. ```APIDOC Ping: online-service-navigation Description: This ping is sent on around a daily basis and contains details about participant navigation to the tracked online services. Metrics: - Name: online_service_navigation.aggregation_period_start_time Type: datetime Description: The start time of the current aggregation period. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: null Expiration: never Data Sensitivity: null - Name: online_service_navigation.online_service_data Type: event Description: Accumulated participant navigation data for each of the tracked Google services and online services. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: - attention_time: Total attention time during the current aggregation period. - completed_transaction_count: Count of transactions completed during the current aggregation period. - dwell_time: Total dwell time during the current aggregation period. - page_visit_count: Count of pages visited during the current aggregation period. - service_name: The name of the service. Expiration: never Data Sensitivity: null - Name: online_service_navigation.ping_time Type: datetime Description: The time that the data submission ping was generated. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: null Expiration: never Data Sensitivity: null - Name: rally.id Type: uuid Description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. Data Reviews: [Review 1](https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0) Extras: null Expiration: never Data Sensitivity: null ``` -------------------------------- ### Rally Client ID Metric Source: https://github.com/mozilla-extensions/search-engine-usage-study/blob/main/docs/metrics.md Defines the Rally client ID metric, which is a UUID generated by the Rally SDKs. Special values indicate test payloads or missing IDs. This metric is included in the study-enrollment ping. ```APIDOC Metric: rally.id Type: uuid Description: The id of the Rally client. This is generated by the Rally SDKs. A value of 00000000-0000-0000-0000-000000000000 indicates a test payload. A value of 11111111-1111-1111-1111-111111111111 indicates that the Rally id was not found or properly set. Data Reviews: https://docs.google.com/document/d/1TDfq3wwX2lPgCPVnksWaMtvEKiPCNuAQxITfob38Ga0 Expiration: never ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.