Skip to content
Open
Changes from all 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
5 changes: 5 additions & 0 deletions assets/src/mobile-redirection.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
// from ensuing. See <https://github.com/ampproject/amp-wp/issues/5767>.
window.stop(); // Stop loading the page! This should cancel all loading resources.

// Pass along referrer so that amp-analytics can report the correct referrer.
if ( document.referrer ) {
amphtmlUrlObject.searchParams.set( 'amp_referrer', document.referrer );
}

// Replace the current page with the AMP version.
location.replace( amphtmlUrlObject.href );
}
Expand Down