adobe / reactor-extension-googledatalayer

Extension for Adobe Experience Platform Tags that enables management of a Google data layer.
https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/adobe/google-data-layer/overview.html
Apache License 2.0
4 stars 5 forks source link

Improve listener logic. #2

Closed dompuiu closed 2 years ago

dompuiu commented 2 years ago

Description

Changed the code so that a listener is added on document.body only once. And only if there is a rule with the Google DL Push Event.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

dompuiu commented 2 years ago

On a separate note, I see you added a Custom Event polyfill for IE. But the library code is a mix of ES5 and ES6 (const is used in the code). I think you need to decide if you really want to support IE. I wouldn't. But if you decide to support it, all the code needs to be ES5. Otherwise it won't run in IE.

brobatr commented 2 years ago

On a separate note, I see you added a Custom Event polyfill for IE. But the library code is a mix of ES5 and ES6 (const is used in the code). I think you need to decide if you really want to support IE. I wouldn't. But if you decide to support it, all the code needs to be ES5. Otherwise it won't run in IE.

hi @dompuiu this came from an observation from Brent, so I assumed that what we have, ES6, is OK (I think IE11 does support const with limitations), but that CustomEvent is a problem. Since we removed the transpile I had given up on IE! I'll review IE11 compatibility with what we have and decide whether to remove the polyfill again or not