Created
June 15, 2019 09:43
-
-
Save tiagogm/5ff4a8b6ca9624229da99cc1a1f143d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const pushEvent = (event: IEvent) => { | |
| if (typeof window === 'undefined' || !(window as any).dataLayer) { | |
| return; | |
| } | |
| window.dataLayer.push({ event: event.name, ...event.properties }); | |
| }; | |
| export const gtm = { | |
| pushEvent | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment