Adobe Launch page load rules not firing on second page view | Community
Skip to main content
bellis0
Level 2
January 23, 2021
Solved

Adobe Launch page load rules not firing on second page view

  • January 23, 2021
  • 3 replies
  • 9891 views

Hi All,

 

Apologies for this being somewhat vague but we have not been able to pinpoint the reason for this very strange issue. The issue is that when a user first lands on our website everything is loading as expected, but after navigating to any other page on the site (the second page view), the majority of our page load rules do not fire. (Note: this is NOT a single page app, so page load is the correct trigger). Also to note, as soon as you navigate a second time and onward (3rd page view+) everything works fine again. 

 

I will be happy to share more specific information on the 3rd party tags that are associated with this issue, but I just wanted to throw this out there to see if anyone has experienced this before.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Andrey_Osadchuk

Thank you for sharing the link!

 

First, pay attention to the errors in the console. Here is what I could see on the first page

and the following error is on the contact us page (second page):

 

Regarding the tags that may fail to fire, I have looked at the setup with the Launch Inspector and did not find the rule "PL : Top : All Pages". However, there is a rule "PL : Top : All : All Pages" with some custom code that should fire gtag.

 

The 6th action in the rule looks as follows, is it the tag you were referring to as the failed tag?

 

if (_satellite.getVar("are Targeting Cookies Allowed")) { var currentTagName = "Performics Google Global Site Tag"; _satellite.setVar("Current Tag Name", currentTagName); _satellite.getVar("Tag Started"); _satellite.getVar("ctl.util.loadScript"); //Global site tag (gtag.js) _satellite.ctl.util.loadScript({ src: "//www.googletagmanager.com/gtag/js?id=DC-10006467", preLoad: function () { window.dataLayer = window.dataLayer || []; window.gtag = function (){dataLayer.push(arguments);} gtag("js", new Date()); gtag('config', 'DC-10006467'); gtag("config", "DC-9129572"); // PFX Global Site Tag gtag('config', 'AW-626667738'); // added 8/7/20 gtag('config', 'AW-608245086'); // added 8/31/20 } }); _satellite.setVar("Current Tag Name", currentTagName); _satellite.getVar("Tag Finished"); }

 

 

The call of "_satellite.ctl.util.loadScript()" looks quite odd. Do you know what this is and why this is used?

A similar call is also used in the 8th action too.

 

 

3 replies

yuhuisg
Community Advisor
Community Advisor
January 24, 2021

Are there any conditions in your page load rules?

When you enable Launch logging in the Adobe Experience Cloud Platform Debugger, do you get any log output about your page load rules on the 2nd pageview?

Level 2
August 16, 2023

Hi @yuhuisg I've an opposite situation, core-page bottom rule with conditions fires on second page load, and not first. Why a rule fires on page refresh and not on first page load?

yuhuisg
Community Advisor
Community Advisor
August 17, 2023

The Core > Page Bottom event fires under 2 situations:

  1. When the browser encounters a _satellite.pageBottom() line in HTML or JavaScript. By convention, this is usually written near the end of the HTML </body> content.
  2. If there is no _satellite.pageBottom() call in the page at all, then when the browser's DOM Ready event is triggered. In AEP Tags, this event is triggered when the browser triggers the document.readyState event with the "interactive" value. See https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState.

In your case, check the following:

  • If you have _satellite.pageBottom() in your web page's code, is there any other code that might prevent the browser from running it?
  • If you don't have _satellite.pageBottom() in your web page's code, is there any page element that might prevent the browser from sending its document.readyState event at first page load, but that error doesn't occur in subsequent page loads?

I've seen the second case happen before, usually because there was some other resource (e.g. an external JS script) that took a long time to load, so it would fail at the first page load, but then succeed on the second page load when more time had elapsed already to let that resource load properly.

You can also try replacing your Core > Page Bottom event with the Core > DOM Ready event to see if you still encounter the same problem. If you do, then it would point to the second situation, i.e. there is something in the page that prevents document.readyState from being set properly at first page load.

Andrey_Osadchuk
Level 10
January 25, 2021

Could you share a link?

bellis0
bellis0Author
Level 2
January 25, 2021
Hi Andrey, here is a link: https://www.lumen.com/es-ar/home.html. The issue is occurring on a handful of our international sites, such as this one. The issue can be best recreated incognito, and by closing the browser after every test. Upon hitting the home page, you can see a good representation of the number of tags that we have firing across the majority of the site. When you visit another page (contact us for example) you will see far less tags (easiest to see in Omnibug), but you will see that our PL : Top : All Pages rule does in fact fire (yet gtag is not loading/defined on the page).
Andrey_Osadchuk
Andrey_OsadchukAccepted solution
Level 10
January 25, 2021

Thank you for sharing the link!

 

First, pay attention to the errors in the console. Here is what I could see on the first page

and the following error is on the contact us page (second page):

 

Regarding the tags that may fail to fire, I have looked at the setup with the Launch Inspector and did not find the rule "PL : Top : All Pages". However, there is a rule "PL : Top : All : All Pages" with some custom code that should fire gtag.

 

The 6th action in the rule looks as follows, is it the tag you were referring to as the failed tag?

 

if (_satellite.getVar("are Targeting Cookies Allowed")) { var currentTagName = "Performics Google Global Site Tag"; _satellite.setVar("Current Tag Name", currentTagName); _satellite.getVar("Tag Started"); _satellite.getVar("ctl.util.loadScript"); //Global site tag (gtag.js) _satellite.ctl.util.loadScript({ src: "//www.googletagmanager.com/gtag/js?id=DC-10006467", preLoad: function () { window.dataLayer = window.dataLayer || []; window.gtag = function (){dataLayer.push(arguments);} gtag("js", new Date()); gtag('config', 'DC-10006467'); gtag("config", "DC-9129572"); // PFX Global Site Tag gtag('config', 'AW-626667738'); // added 8/7/20 gtag('config', 'AW-608245086'); // added 8/31/20 } }); _satellite.setVar("Current Tag Name", currentTagName); _satellite.getVar("Tag Finished"); }

 

 

The call of "_satellite.ctl.util.loadScript()" looks quite odd. Do you know what this is and why this is used?

A similar call is also used in the 8th action too.

 

 
Andrey_Osadchuk
Level 10
January 25, 2021
And pay attention to the IF condition in the custom code. The code will be executed only when _satellite.getVar("are Targeting Cookies Allowed") returns TRUE.