Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!
SOLVED

Inline Java Script vs Custom Code in Launch

Avatar

Level 1

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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.

Avatar

Level 1
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.