Anti-flicker | Community
Skip to main content
nicholase927171
Level 2
October 11, 2022
Solved

Anti-flicker

  • October 11, 2022
  • 2 replies
  • 2104 views

Hi,

 

I have the pre-hiding code snippet sitting above my tag manager in the head.

 

In the tag manager (GTM) I am triggering AT.js. 

 

Should I be removing the default pre-hiding code from the Target javascript file if I am running it prior to the tag manager?

 

If so, what is the best way of removing it? 

 

Thanks

 

 

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 Perrin_Ennen

You only need the pre-hiding snippet if Target is loaded asynchronously. It is asynchronous via the GTM.

However, here you still have to consider which rules are created in GTM to load Target. If there are rules or conditions that control whether the target should be loaded at all (e.g. Consent etc.) - this is important to know.

 

An elegant method is - to write a kind of wrapper code around the pre-hiding snippet - which checks the same condition if Target should be loaded at all. Classic example is if Consent is present or not. So in case Target is not loaded intitially - the pre-hiding snippet will not be executed.

 

If Target should be loaded - then Target itself removes the pre-hiding via at.js.

2 replies

Gaureshk_Kodag
Adobe Employee
Adobe Employee
October 13, 2022

Hi @nicholase927171 

 

I am assuming that by AT JavaScript file you mean at.js. I would recommend not removing any code from AT JavaScript file. 

Perrin_Ennen
Community Advisor
Community Advisor
October 13, 2022

I agree with @gaureshk_kodag. I wouldn't change anything in at.js itself. That doesn't make much sense because you don't want to change the code every time you update the at.js because there is a new version. Besides, the logic in the at.js is correct and works even if the interaction with the pre-hidings snippet is correct. It is important to mention that the pre-hidings snippet is executed as early as possible in the head.

Perrin_Ennen
Community Advisor
Perrin_EnnenCommunity AdvisorAccepted solution
Community Advisor
October 13, 2022

You only need the pre-hiding snippet if Target is loaded asynchronously. It is asynchronous via the GTM.

However, here you still have to consider which rules are created in GTM to load Target. If there are rules or conditions that control whether the target should be loaded at all (e.g. Consent etc.) - this is important to know.

 

An elegant method is - to write a kind of wrapper code around the pre-hiding snippet - which checks the same condition if Target should be loaded at all. Classic example is if Consent is present or not. So in case Target is not loaded intitially - the pre-hiding snippet will not be executed.

 

If Target should be loaded - then Target itself removes the pre-hiding via at.js.

nicholase927171
Level 2
October 13, 2022

Thanks for the reply.  My concern was that the pre-hiding snippet is placed twice. Once above AT.js but also within the Target script itself. Sounds like that isn't an issue...

Perrin_Ennen
Community Advisor
Community Advisor
October 13, 2022

Yes the at.js is powerful in itself and can also cover e.g. a SPA accordingly and also holds an own pre-hiding in itself which can also be influenced via e.g. the targetGlobalSettings() function. But this should not bother you.

 

But do you have flickering problems in general?