Inline Java Script vs Custom Code in Launch

suryapramodhd73

13-02-2020

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.

implementation

Accepted Solutions (0)

Answers (1)

Answers (1)

Andrey_Osadchuk

MVP

13-02-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.