question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent self-referrals in AMP pages

See original GitHub issue

Currently, when not overridden, the Viewer of an AMP page always reports as referrer window.document.referrer

This has the side effect that AMP-ANALYTICS always reports as referrer the previous visited site, and does not keep the original referrer of the current session when, for example, a user visits a second page.

At the end this means that a site like AMP Project, or a PWA that uses AMP Shadow, has almost all its traffic reported as referral.

I think that AMP could have the notion of session, like it already has for client in cid-impl.js, so we can do things like preserving the referral for the current session.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
avimehtacommented, Aug 22, 2017

correct. This issue will get fixed by that PR.

On Tue, Aug 22, 2017 at 1:17 PM, Rudy Galfi notifications@github.com wrote:

It sounds like #11027 https://github.com/ampproject/amphtml/pull/11027 fixes this according to solution 2 described previously.

@avimehta https://github.com/avimehta @lannka https://github.com/lannka Can you confirm this will also cover the " https://google.com -> https://daily.spiegel.de -> https://daily.spiegel.de/news/…" case (thereby making the recommendation to add https://daily.spiegel.de to referral exclusion list obsolete)?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/7184#issuecomment-324139444, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK8n6_7VnnX_yEVSdcSfA3o8xRytAQDks5sazdNgaJpZM4LsqMN .

1reaction
jridgewellcommented, Jan 24, 2017

Oohhh, I think I get it now:

  1. Search for [Amp By Example]
  2. Click top result
  3. Click any link (should cause a top page navigation, not iframe navigation)
  4. In Inspector: window.services.viewer.obj.getReferrerUrl()

In this case, I get https://ampbyexample-com.cdn.ampproject.org/v/s/ampbyexample.com/?amp_js_v=6 as my referrer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Self-Referrals - Analytics Help - Google Support
A self-referral is referral traffic that originates from pages within your own domain. In general, self-referrals indicate that there are Analytics ...
Read more >
AMP Tech Guide: Making It Work - Perficient, Inc.
1. The first step is to make sure that 'ampproject.org' is added into the Referral Exclusion List under the Property Settings in the...
Read more >
Why the bounce rate of my AMP pages is so high?
1. On all your non-AMP pages, set the value of the parameter 'useAMPclientID' to «true» · 2. On all your AMP pages, include...
Read more >
AMP Google Analytics Tracking - Learn to track AMP pages
Learn how to track amp pages in Google Analytics through the AMP Google ... like Cloudflare, then disable it for AMP pages via...
Read more >
Instant-loading AMP pages from your own domain
Your page appears under your URL instead of the google.com/amp URL. an animation showing how the URL stays consistent with the publisher's URL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found