Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Port advertising and article-contents modules from "Beyond the Paywall". #134

Merged
merged 18 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
899 changes: 420 additions & 479 deletions common/config/rush/npm-shrinkwrap.json

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions extensions/attention-stream/docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,60 @@ This means you might have to go searching through the dependency tree to get a f

# Pings

- [advertisements](#advertisements)
- [article-contents](#article-contents)
- [deletion-request](#deletion-request)
- [events](#events)
- [study-enrollment](#study-enrollment)
- [user-journey](#user-journey)

## advertisements

Advertisements

**Data reviews for this ping:**

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1778367>

**Bugs related to this ping:**

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1778196>

All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.

In addition to those built-in metrics, the following metrics are added to the ping:

| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
| --- | --- | --- | --- | --- | --- | --- |
| advertisements.ads |[text](https://mozilla.github.io/glean/book/user/metrics/text.html) |Ads |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| advertisements.body |[text](https://mozilla.github.io/glean/book/user/metrics/text.html) |Body of the current page |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| advertisements.page_id |[uuid](https://mozilla.github.io/glean/book/user/metrics/uuid.html) |A unique ID for this visit |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| advertisements.url |[url](https://mozilla.github.io/glean/book/user/metrics/url.html) |URL for the current page |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |

## article-contents

Article contents

**Data reviews for this ping:**

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1778367>

**Bugs related to this ping:**

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1778196>

All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.

In addition to those built-in metrics, the following metrics are added to the ping:

| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
| --- | --- | --- | --- | --- | --- | --- |
| article_contents.page_id |[uuid](https://mozilla.github.io/glean/book/user/metrics/uuid.html) |A unique ID for this visit |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| article_contents.survey_id |[uuid](https://mozilla.github.io/glean/book/user/metrics/uuid.html) |A survey ID for this user |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| article_contents.text_content |[text](https://mozilla.github.io/glean/book/user/metrics/text.html) |Contents of current page |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| article_contents.title |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |Title of the current page |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |
| article_contents.url |[url](https://mozilla.github.io/glean/book/user/metrics/url.html) |URL for the current page |[Bug 1778367](https://bugzilla.mozilla.org/show_bug.cgi?id=1778367)||never | |

## deletion-request

This is a built-in ping that is assembled out of the box by the Glean SDK.
Expand Down
19 changes: 5 additions & 14 deletions extensions/attention-stream/manifest.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Mozilla",
"manifest_version": 3,
"name": "Rally Attention Stream",
"version": "0.4.3",
"version": "0.4.5",
"homepage_url": "https://github.com/mozilla/rally",
"browser_specific_settings": {
"gecko": {
Expand All @@ -23,9 +23,10 @@
"webNavigation",
"webRequest",
"storage",
"unlimitedStorage"
"unlimitedStorage",
"scripting"
rhelmer marked this conversation as resolved.
Show resolved Hide resolved
],
"host_permissions:": [
"host_permissions": [
"<all_urls>"
],
"content_scripts": [
Expand All @@ -37,16 +38,6 @@
"js": [
"dist/main.content.js"
]
},
{
"matches": [
"<all_urls>"
],
"js": [
"dist/browser-polyfill.min.js",
"dist/webScience/pageManager.content.js",
"dist/webScience/pageNavigation.content.js"
]
}
],
"action": {
Expand All @@ -56,4 +47,4 @@
"service_worker": "dist/background-loader.js"
},
"incognito": "not_allowed"
}
}
17 changes: 4 additions & 13 deletions extensions/attention-stream/manifest.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Mozilla",
"manifest_version": 3,
"name": "Rally Attention Stream",
"version": "0.4.3",
"version": "0.4.5",
"homepage_url": "https://github.com/mozilla/rally",
"browser_specific_settings": {
"gecko": {
Expand All @@ -20,9 +20,10 @@
"webNavigation",
"webRequest",
"storage",
"unlimitedStorage"
"unlimitedStorage",
"scripting"
],
"host_permissions:": [
"host_permissions": [
"<all_urls>"
],
"content_scripts": [
Expand All @@ -34,16 +35,6 @@
"js": [
"dist/main.content.js"
]
},
{
"matches": [
"<all_urls>"
],
"js": [
"dist/browser-polyfill.min.js",
"dist/webScience/pageManager.content.js",
"dist/webScience/pageNavigation.content.js"
]
}
],
"background": {
Expand Down
137 changes: 137 additions & 0 deletions extensions/attention-stream/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,140 @@ user_journey:
notification_emails:
- [email protected]
expires: never

article_contents:
page_id:
type: uuid
description: |
A unique ID for this visit
lifetime: ping
send_in_pings:
- article-contents
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

survey_id:
rhelmer marked this conversation as resolved.
Show resolved Hide resolved
type: uuid
description: |
A survey ID for this user
lifetime: ping
send_in_pings:
- article-contents
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

url:
type: url
description: |
URL for the current page
lifetime: ping
send_in_pings:
- article-contents
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

title:
type: string
description: |
Title of the current page
lifetime: ping
send_in_pings:
- article-contents
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

text_content:
type: text
description: |
Contents of current page
lifetime: ping
send_in_pings:
- article-contents
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

advertisements:
page_id:
type: uuid
description: |
A unique ID for this visit
lifetime: ping
send_in_pings:
- advertisements
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

url:
type: url
description: |
URL for the current page
lifetime: ping
send_in_pings:
- advertisements
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

body:
type: text
description: |
Body of the current page
lifetime: ping
send_in_pings:
- advertisements
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never

ads:
type: text
description: |
Ads
rhelmer marked this conversation as resolved.
Show resolved Hide resolved
lifetime: ping
send_in_pings:
- advertisements
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778196
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1778367
notification_emails:
- [email protected]
expires: never
rhelmer marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 14 additions & 13 deletions extensions/attention-stream/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions extensions/attention-stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rally-attention-stream",
"version": "0.4.3",
"version": "0.4.5",
"scripts": {
"build": "cp manifest.prod.json manifest.json && npm run build:glean && rollup -c 2>&1 && npm run tailwind",
"dev": "cp manifest.dev.json manifest.json && npm run build:glean && npm run clean && npm run tailwind && npm run dev:extension",
Expand Down Expand Up @@ -29,6 +29,7 @@
"devDependencies": {
"@babel/preset-env": "^7.11.5",
"@babel/preset-typescript": "^7.17.12",
"@mozilla/readability": "^0.4.2",
rhelmer marked this conversation as resolved.
Show resolved Hide resolved
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-replace": "^3.0.0",
Expand All @@ -53,11 +54,11 @@
"web-ext": "^7.0.0"
},
"dependencies": {
"dexie": "^3.2.2",
"pako": "^2.0.4",
"@mozilla/glean": "^1.0.0",
"@mozilla/rally-sdk": "^0.9.32",
"@mozilla/web-science": "^0.5.1",
"dexie": "^3.2.2",
"pako": "^2.0.4",
"tailwindcss": "^3.0.24",
"webextension-polyfill": "^0.8.0"
},
Expand Down
Loading