ampproject / ampproject/amphtml

Amp-next-page not getting the refeererDocument from the Host Page

Open
#33,430 5 comments 0 reactions 0 assignees View on GitHub
Component: amp-next-page P2: Soon Stale Type: Bug WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?

When giving a pageview from an amp-analytics tag inside a amp-next-page, the documentReferrer should be the hostPage, but it's empty.

## How do we reproduce the issue?

Here you have an example: https://output.jsbin.com/gujosag. Try it in mobile ans let the amp-next-page build. You'll see two calls in the network to ?ping. In ref you have the ${documentReferrer] variable, it's empty on the pageviw of the amp-next-page where it should be the host page.

## What browsers are affected?

All.

## Which AMP version is affected?

All.

Contributor guide

Open the contributing guide

Research direction

Start with the linked JSBin reproduction and inspect the amp-next-page and amp-analytics implementations to trace documentReferrer during the second pageview. Reproduce the two ?ping network calls on mobile and verify that the amp-next-page request reports the host page as its referrer.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.