Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated source grouping to use known referrers #15432

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

rishabhgrg
Copy link
Contributor

@rishabhgrg rishabhgrg commented Sep 19, 2022

Instead of collecting and deciding on the Medium/Source for all of these ourselves, we will be leveraging Plausible's already well organized list here for grouping incoming referrers.

  • adds new package with known referrers list from Plausible's list
    • transforms yaml list from Plausible to JSON format, and flattened out with each domain/url as a separate key
  • updates attribution logic to use known referrers list for grouping Source and Medium

@codecov
Copy link

codecov bot commented Sep 19, 2022

Codecov Report

Base: 53.08% // Head: 53.17% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (cc02d60) compared to base (b2b6be9).
Patch coverage: 96.42% of modified lines in pull request are covered.

❗ Current head cc02d60 differs from pull request most recent head c1f2cc1. Consider uploading reports for the commit c1f2cc1 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15432      +/-   ##
==========================================
+ Coverage   53.08%   53.17%   +0.08%     
==========================================
  Files        1410     1406       -4     
  Lines       88515    88433      -82     
  Branches     9554     9570      +16     
==========================================
+ Hits        46988    47024      +36     
+ Misses      40573    40457     -116     
+ Partials      954      952       -2     
Impacted Files Coverage Δ
...host/member-attribution/lib/referrer-translator.js 96.58% <96.42%> (+5.87%) ⬆️
ghost/link-tracking/lib/link-tracking.js 47.82% <0.00%> (-52.18%) ⬇️
.../core/server/services/link-click-tracking/index.js 0.00% <0.00%> (-22.86%) ⬇️
...e/core/server/services/member-attribution/index.js 0.00% <0.00%> (-17.78%) ⬇️
ghost/core/core/boot.js 21.25% <0.00%> (-0.09%) ⬇️
...ore/core/server/services/link-redirection/index.js 0.00% <0.00%> (ø)
...ervices/link-click-tracking/LinkClickRepository.js
...host/link-tracking/lib/LinkClickTrackingService.js
ghost/link-replacer/lib/LinkReplacer.js
...ervices/link-redirection/LinkRedirectRepository.js
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rishabhgrg rishabhgrg force-pushed the ref-from-known-ext-urls branch from e6f8374 to 080f954 Compare September 19, 2022 14:52
@rishabhgrg rishabhgrg requested a review from ErisDS September 19, 2022 14:54
@rishabhgrg
Copy link
Contributor Author

rishabhgrg commented Sep 19, 2022

@ErisDS The main thing I'd love to get your 👀 on here is the new @tryghost/referrers package and the pattern it uses to expose the JSON with list of known referrers for attribution service. Currently it's following the structure same as Nameservers package, but was wondering if it will make sense for it to use .js format to expose the list which is closer to pattern used for rest of monorepo packages.

Update: Discussed on Slack, will keep the JSON pattern for now and we can revisit this in future if any changes are needed

@rishabhgrg rishabhgrg force-pushed the ref-from-known-ext-urls branch from 080f954 to cc02d60 Compare September 19, 2022 14:58
refs TryGhost/Team#1923

- leverages well organized list from Plausible to create known referrers list package for grouping incoming referrers - https://github.com/plausible/analytics/blob/5d4918b66b862562cb42e3d7c3af86674a40bdf3/priv/ref_inspector/referers.yml
- original list has been modified from yaml to json
refs TryGhost/Team#1923

- updates referrer translator logic to use grouping for known domains/urls to calculate source and medium
- returns first external ref url if nothing matches in history in first pass
@rishabhgrg rishabhgrg force-pushed the ref-from-known-ext-urls branch from cc02d60 to c1f2cc1 Compare September 19, 2022 16:16
@rishabhgrg rishabhgrg merged commit e422ab4 into TryGhost:main Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant