Inline Java Script vs Custom Code in Launch | Community
Skip to main content
suryapramodhd73
February 13, 2020
Solved

Inline Java Script vs Custom Code in Launch

  • February 13, 2020
  • 1 reply
  • 1746 views

All am doing research on analytics and looked at few projects now. I have a question on difference between inline java script and using Launch custom code.
I have seen projects which are using only data elements with JavaScript Variable and direct call rules only. This is making Launch mostly configuration tool and HTML page is doing lot of work to populate data elements. There are other kind of projects which use all launch features CSS selectors for data elements and rules and perform whole process. This has lot of advantages and decouples the implementation from website. But as per all of your experiences what is the best and most used approach.

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 Andrey_Osadchuk

The best approach is somewhere in the middle. When the implementation fully relies on data layer (global JS variables) then any new change requires an update on the website that takes long and sometimes it's now worth it resources wise. When the data elements are mapped only to CSS selectors, there is a high risk of data loss due to html/markup changes.

Consider mapping the Launch data elements to data layer whenever possible, for the rest use the other available options.

1 reply

Andrey_Osadchuk
Andrey_OsadchukAccepted solution
Level 10
February 14, 2020

The best approach is somewhere in the middle. When the implementation fully relies on data layer (global JS variables) then any new change requires an update on the website that takes long and sometimes it's now worth it resources wise. When the data elements are mapped only to CSS selectors, there is a high risk of data loss due to html/markup changes.

Consider mapping the Launch data elements to data layer whenever possible, for the rest use the other available options.

suryapramodhd73
February 15, 2020
ok so you suggest to utilize data layer to populate data elements and use other options as required. But as you mentioned this will required changes to the website and may require redeploy whenever there are changes to data layer.