best practices for handling 3rd party pixel or custom code in Launch

Avatar

Avatar
Validate 1
Level 3
gokula
Level 3

Likes

25 likes

Total Posts

90 posts

Correct reply

7 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Ignite 3
Ignite 1
View profile

Avatar
Validate 1
Level 3
gokula
Level 3

Likes

25 likes

Total Posts

90 posts

Correct reply

7 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Ignite 3
Ignite 1
View profile
gokula
Level 3

17-03-2021

Hello, 

can someone share what's the best practices for handling 3rd party pixel or custom code in Launch. 

 

Reason being - having the launch property with multiple rules and data elements - we deploy the 3 party pixel either using extension or by adding as custom code in action part of the rule.  

 

Now when we add the any custom js into action part of the rule - That means, for every single action of the “custom code” launch generates additional sub file. 

 

This sub file may be less or big in size depending on the JS code but  - if there are multiple sub files getting generated on landing page - its impact on the performance of the page. 

 

So is there any way we can optimize this and includes all the things in Launch main library and not in sub files. 

 

@thebenrobb 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Boost 3
Level 1
tim_funk
Level 1

Likes

3 likes

Total Posts

18 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Contributor
Applaud 5
Shape 1
Boost 1
View profile

Avatar
Boost 3
Level 1
tim_funk
Level 1

Likes

3 likes

Total Posts

18 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Contributor
Applaud 5
Shape 1
Boost 1
View profile
tim_funk
Level 1

06-04-2021

An easy way to cheat is to add your custom code as a condition. Conditions are loaded with the main js file. You can also in your condition do something like

window.setTimeout(function(){ /*really load*/}, 1000) which defers the execution of the code for another second.

 

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

196 likes

Total Posts

603 posts

Correct reply

119 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

196 likes

Total Posts

603 posts

Correct reply

119 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

18-03-2021

If there isn't an extension for your pixel, then you're stuck with Custom Code.

If you're using Custom Code, why can't you include everything in one big Custom Code action? Then only one sub file will need to be downloaded.