Expand my Community achievements bar.

Join us for an upcoming in-person Adobe Target Skill Builders event ~~> We're hosting these live learning opportunities to equip you with the knowledge and skills to leverage Target successfully. Learn more to see if we'll be coming to a city near you!
SOLVED

Disable pre hiding snippet

Avatar

Level 4

Our devs have asked to disable the pre-hiding snippet. They do not have it implemented in the source code. How can I disable it through Adobe Launch? Below is the current implementation through custom code.

 

image (1).png

 

image.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @xcode2295,
if there really isn't a pre-hiding snippet in the source code. Is it possibly via another rule in Adobe Experience Platform Launch that code is inserted on the page.

 

Basically a pre-hiding snippet is recommended when Adobe Target is loaded asynchronously. However, care must be taken here to ensure that it is only executed when Adobe Target is loaded. Not if e.g. a Consent was not yet given - which only enables the loading of Adobe Target.

 

Also as a note. The at.js has an additional pre-hidings snippet integrated. This is active as soon as the at.js script has been executed - until the first Adobe Target request has arrived - or a maximum of 3 seconds.


With the following code you can also interrupt/delete the pre-hiding snippet manually.

var preHidingSnippet = document.head.querySelector("#at-body-style");
if (preHidingSnippet !== null) document.head.removeChild(preHidingSnippet);
document.body.style.opacity = "1";

 

What I still notice is that you manually include the at.js here. What is also possible is to include Adobe Target via an extension - this is then at least two actions (Load Target and Fire Page Load Request) - with Fire Page Load Request you can also select Body Hiding Disabled (if that is desired).

 

Best regards

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @xcode2295,
if there really isn't a pre-hiding snippet in the source code. Is it possibly via another rule in Adobe Experience Platform Launch that code is inserted on the page.

 

Basically a pre-hiding snippet is recommended when Adobe Target is loaded asynchronously. However, care must be taken here to ensure that it is only executed when Adobe Target is loaded. Not if e.g. a Consent was not yet given - which only enables the loading of Adobe Target.

 

Also as a note. The at.js has an additional pre-hidings snippet integrated. This is active as soon as the at.js script has been executed - until the first Adobe Target request has arrived - or a maximum of 3 seconds.


With the following code you can also interrupt/delete the pre-hiding snippet manually.

var preHidingSnippet = document.head.querySelector("#at-body-style");
if (preHidingSnippet !== null) document.head.removeChild(preHidingSnippet);
document.body.style.opacity = "1";

 

What I still notice is that you manually include the at.js here. What is also possible is to include Adobe Target via an extension - this is then at least two actions (Load Target and Fire Page Load Request) - with Fire Page Load Request you can also select Body Hiding Disabled (if that is desired).

 

Best regards

Avatar

Level 4

Thank you so much! This is super helpful. I was able to select Body Hiding Disabled within Fire Page Load Request and that solved the issue for me.