-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple GTM containers in vue throws errors in production #237
Comments
It might have todo something with this line |
Just looked at the code, shouldn't this be a problem on local if this were the case? It doesn't return this error locally. |
Are there more options to be passed in here? I understand most are optional @Shinigami92 |
No I assume that's it, your options looks valid to me. |
@Shinigami92, I've confirmed that the minifier does not impact the array of ids. It appears the |
Please note that I have a full-time job, several other OpenSource projects (like @prettier/plugin-pug and faker), managing also stuff in Vite and faker and then also want to have time for myself So I cannot guarantee a fix sooner than later Lines 16 to 22 in a481e3f
|
@sadelokiki There is something weird going on here 🤔 So calling it with <script src="https://www.googletagmanager.com/gtm.js?id=GTM-M4X2575"/>
<script src="https://www.googletagmanager.com/gtm.js?id=GTM-T98TL4V"/> Here you can see for each id in the array Lines 70 to 73 in a481e3f
To explicitly test this behavior, I added a test to ensure that this is done correctly and the tests are passing: https://github.com/gtm-support/core/blob/402056006888b1d089b72ab621bccd526a99be55/tests/gtm-support.test.ts#L172-L186 |
I am able to add multiple ids in the id array and it loads well and properly adds the script on local
However, when the code makes it to production, it throws invalid errors because the IDs are getting concatenated(probably due to minified files, not sure). How can I fix this?
Pictures of local and deployed version are attached
The text was updated successfully, but these errors were encountered: