DavidWells / DavidWells/analytics

@analytics/aws-pinpoint sending empty string if document.referrer is an empty string

Open
#267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.7k
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Description

Noticed that our pinpoint and eventually our analytics data store is sending/storing document.referrer value as "" or EMPTY if it is an empty string here. However, also noticed that Google Analytics does not send a dr (document referrer) value if the string is empty. Therefore, I'm assuming GA is also setting a NULL value for these cases. I think it's ubiquitously known that an empty string means that the visitor went to the site directly. However, doesn't seem to make sense or provide any use in storing an empty string. Here are some screenshots of GA sending a referrer and not sending a referrer when it is an empty string

Referrer value gets sent
Screen Shot 2022-03-30 at 9 15 33 AM
Empty string - does not get sent with payload
Screen Shot 2022-03-30 at 9 15 43 AM

I can create the PR here shortly for this. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/analytics-plugin-aws-pinpoint/src/browser.js around line 180, where document.referrer is included in the Pinpoint data. Compare the current handling with the reported Google Analytics behavior. Done means an empty document.referrer is not sent or stored as an empty value, while non-empty referrers continue to be sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
analytics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.