Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Don’t pass in the window global
Browse files Browse the repository at this point in the history
  • Loading branch information
solocommand committed Apr 2, 2021
1 parent 7673a58 commit 98187f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/marko-web-native-x/utils/gtm-events.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
export const pageLoad = (window) => {
/* eslint-disable no-undef */
export const pageLoad = () => {
const dataLayer = window.dataLayerNativeX;
if (dataLayer) dataLayer.push({ event: 'page_load' });
};

export const outboundLink = (window, url) => {
export const outboundLink = (url) => {
const dataLayer = window.dataLayerNativeX;
if (dataLayer) dataLayer.push({ event: 'outbound_click', outbound_url: url, eventTimeout: 3000 });
};

export const share = (window, provider) => {
export const share = (provider) => {
const dataLayer = window.dataLayerNativeX;
if (dataLayer) dataLayer.push({ event: 'share', social_provider: provider });
};

export const endOfContent = (window) => {
export const endOfContent = () => {
const dataLayer = window.dataLayerNativeX;
if (dataLayer) dataLayer.push({ event: 'scroll_to_bottom' });
};

0 comments on commit 98187f7

Please sign in to comment.