In some cases, you will be using a separate page for checkout, instead of the user checking out directly on the page of the article they were viewing. This way, you won’t be able to see by default from which URL the user came from before they converted.
If any article has a button that redirects them to check out to the separate landing page, and this button isn't contained in a Piano Template, there will be no tracking (_ptid) parameter automatically appended to it.
With the following 3 steps, you're able to add this parameter programmatically:
-
Create a Composer Experience, where you will target all pages and all users
-
Add a RunJS Action card, that will find the Subscribe button which redirects the user to the separate landing page
-
Inside this RunJS card add the parameter
context.trackingIdto the URL. This will append the_ptidparameter to the link
Sample code:
var subscribeButton = document.querySelector('.subscribe-button');
if (subscribeButton) {
let newUrl = new URL(subscribeButton.href);
newUrl.searchParams.set('_ptid', context.trackingId);
subscribeButton.setAttribute("href", newUrl);
}
After this is implemented, the Composer Conversion report for your Pages will contain data about the article the user converted on, even if they've checked out using a separate landing/subscribe page.