Expand my Community achievements bar.

SOLVED

Adobe Launch page load rules not firing on second page view

Avatar

Level 1

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

1.png

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

contact us.png

 

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.

 

 

View solution in original post

15 Replies

Avatar

Community Advisor

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?

Avatar

Level 1
Hi, appreciate the reply! In regard to the Debugger I forgot to mention one important detail which is that if the page is refreshed at any point, the tags will fire perfectly fine. So if a user navigates to the home page and then refreshes, and then navigates to another page the issue does not occur. So because the debugger automatically refreshes the page, we have not been able to use this tool to help solve the issue.

Avatar

Level 1
In regard to the page load conditions, we have targeted 3 rules that are not firing correctly, and one that is technically firing but very few tags within the rule are actually working. For the first 3 rules, the conditions are mainly applying regex to the url and also based on our cookie compliance tool (fire if targeting cookies are allowed, etc. ). The rule that half the tags are working in is a page load TOP all pages without any conditions. An example of the strange behavior is that our Google Universal Analytics tag is in that rule and looks to be firing because we can see the script on the page, but the google account configuration is not working properly so gtag is not available on the page.

Avatar

Level 2

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?

Avatar

Community Advisor

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.

Avatar

Level 2

the page was getting redirected and the condition was not met. Now, modified the condition accordingly, so its working now! thanks a lot @yuhuisg 

Avatar

Level 1
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).

Avatar

Correct answer by
Level 10

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

1.png

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

contact us.png

 

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.

 

 

Avatar

Level 10
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.

Avatar

Community Advisor
@bellis0 after some troubleshooting, I've determined that the "appendChild" error is coming from the "PL : Top : BUS : All Pages (LATAM Only)" rule. The error arises because this rule fires at Library Loaded, which is when the Launch JS script is loaded, which itself is loaded inside <HEAD>... when <BODY> has not been loaded yet! So the browser can't find document.body (i.e. the <BODY> section), and it throws that error. Try running the "MRP Prelytix" custom code in a rule that uses "DOM Ready" or "Window Loaded".

Avatar

Level 1
Thank you both for the support! To follow up on both of your comments: We were able to solve the appendChild error thanks to your direction @yuhuisg. In regard to your points above, _satellite.ctl.util.loadScript() is just a helper function we added to load scripts. The error you're seeing in the debugger "PL : DOM : Fire AA..." should be taken out since we do not use Target on our Intl sites, so I will do that but it also shouldn't be stopping the other tags from firing (since everything works okay on other page views). As you mentioned, the PL : Top : All : All Pages rule is firing yet gtag is not defined, so that's a good example of the issue that we're seeing. Also to note: since turning the debugger on causes a page refresh, we haven't been using it, as a page refresh seems to cause everything to work properly again. Want to reiterate that I really appreciate the support and if you have any other ideas please let me know!

Avatar

Level 1
So we were able to resolve the issue. It was a combination of the _satellite.ctl.util.loadScript() not seeming to work properly and the storage durations being added to it. Thank you both for the help!

Avatar

Community Advisor
@bellis0 Great! BTW if you want to use the Adobe Debugger's logger but without causing a page reload: Go to any page in the domain, then open your browser's console and enter "_satellite.setDebug(true)". Now the Debugger is in logging mode, and from that point on, you'll start to see logs without needing a reload. This also means that on the current page, e.g. if you're tracking any link clicks, those will show up in the log too, even though you hadn't enabled the logger when loading the page itself.