holidaycheck / react-google-tag-manager

This repository contains a react based implementation for Google's Tag Manager snippet.
MIT License
192 stars 31 forks source link

Broken when no previewVariables is defined #68

Closed goncharov closed 6 years ago

goncharov commented 6 years ago

Hello there. After update to 2.2.0 we've got error when no previewVariables is defined. scriptAsReactgenerates code like this with broken concatenation

j.src='//www.googletagmanager.com/gtm.js?id='+i+dl
+;
f.parentNode.insertBefore(j,f);
HeeL commented 6 years ago

I will have a look today and publish new version if needed

Am 03.11.2017 4:25 nachm. schrieb "Stanislav Goncharov" < notifications@github.com>:

Hello there. After update to 2.2.0 we've got error when no previewVariables is defined. scriptAsReactgenerates code like this with broken concatenation

j.src='//www.googletagmanager.com/gtm.js?id='+i+dl +; f.parentNode.insertBefore(j,f);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/holidaycheck/react-google-tag-manager/issues/68, or mute the thread https://github.com/notifications/unsubscribe-auth/AARkGeZlH7XdW_48fE8l3s8lICkCJErEks5syzBcgaJpZM4QRQT7 .

selaux commented 6 years ago

I see the issue (and we also experience it in our project). Will create a PR.

HeeL commented 6 years ago

Version 2.2.1 has been released. Thanks for reporting/fixing