web performance Issue with adobe launch web sdk | Community
Skip to main content
August 9, 2022
Solved

web performance Issue with adobe launch web sdk

  • August 9, 2022
  • 2 replies
  • 3353 views

hi I am trying to add adobe launch script

https://assets.adobedtm.com/xxxxxxx/xxxxxxxxx/launch-xxxx.min.js

I have some query while adding this 

1. If I add this script in footer with async, try to track event from my component , before this script is loaded then there will be loss of events as of in ga we have datalayer where we push the events it gets tracked as sson as js is loaded, how can i achieve same behaviour as ga in omniture

2. Is there a way we can add batching in request 

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 yuhuisg

1. Add this script in the <head> of your page with async.

2. What are you batching? Can you elaborate on this question?

2 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 9, 2022

May I ask why you are adding the Launch File in the footer (I mean, I understand that you are trying to add the script later in the page to avoid render blocking scripting, but the async should prevent that)? In the instructions Adobe says to add to the head... I really don't know what impacts adding that late in the page will cause... GTM is also supposed to be added to the head of a website... 

 

Just because the JS file is in the head, you can defer the actual tracking to later in the page execution... remember, the Launch file is the tag manager, it can be used to do more than just tracking events... so having it available as soon in your page as possible gives you much more freedom to control when things execute.

 

 

Are your developers pushing the GA DataLayer events manually? Rather than using GTM code to trigger the DataLayer changes... that is the only way I could see you getting away with not having GTM in the head.... If so, you could create your own custom Data Layer and try to do a similar behaviour.. it will require a good coder though.... 

 

Without really seeing the specifics of your implementation I really can only make high level suggestions... 

August 10, 2022

@jennifer_dungan  if we add async in head tag it will start executing script once it is downloaded and because of which it can block my rendering if thread is in between parsing the html, so i want once html rendering is complete then it should execute, which is basically achieved by adding defer, but since right now launch doesn't support defer, wanted to know is there any way i can achieve that my rendering process gets complete then this script gets executed

yuhuisg
Community Advisor
Community Advisor
August 10, 2022

If you need your HTML to finish rendering first before a Rule runs, then in that Rule, use the Core > Window Loaded event. That event will trigger only when the browser has finished loading the window's document, including HTML, scripts, stylesheets and images, i.e. it is equivalent to window.onload().

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
August 9, 2022

1. Add this script in the <head> of your page with async.

2. What are you batching? Can you elaborate on this question?

August 10, 2022

wanted to batch events that are going for track on load, as for every track there will be api hit, so wanted to batch multiple track events and hit less api 

 

@yuhuisg 

yuhuisg
Community Advisor
Community Advisor
August 10, 2022

Such batching is only available with the Mobile SDK for mobile apps. There's no such batching available with Web SDK.

Adobe charges you for the number of hits, which normally corresponds to the number of page views and custom links that you're tracking. So even with the Mobile SDK, Adobe still charges you for the actual number of hits in the batch, regardless of the number of times their endpoint gets hit.