From 6ea898ec57c996ddea665a41be600858d9dab322 Mon Sep 17 00:00:00 2001 From: Robert Heim Date: Thu, 5 Dec 2019 03:15:38 +0100 Subject: [PATCH] omit `gtm_preview` if not in preview mode fixes #48 --- src/Snippets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Snippets.js b/src/Snippets.js index b798e3db..a58c6593 100644 --- a/src/Snippets.js +++ b/src/Snippets.js @@ -5,7 +5,7 @@ import warn from './utils/warn' const Snippets = { tags: function ({ id, events, dataLayer, dataLayerName, preview, auth }) { const gtm_auth = `>m_auth=${auth}` - const gtm_preview = `>m_preview=${preview}` + const gtm_preview = !preview ? '' : `>m_preview=${preview}` if (!id) warn('GTM Id is required')