-
Notifications
You must be signed in to change notification settings - Fork 238
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
[BUG] Enabling Application Insights via Tag Management System #1462
Comments
Hi, the snippet doesn't contain any ES6 syntax (it's actually ES3), however, I did notice that you are using version 4 (see the sv:"4") in the snippet which does have a bug that we recently fixed (#1402). Can you try updating based on the current version (sv:"5") on the readme It also contains a new "onInit: configuration |
Thanks @MSNev I have updated the snippet as follows:
|
Ok, this is going to take some more digging and using the minified snippet is not useful. So... The code for the unminified snippet can be found here (all 327 lines of it) |
Ok, so the issue is not that there is any ES6 only features (this code works in ES3), going over the links the issue appears to be that the google closure-compiler is miss reporting the failure (for apparent convenience of reporting) google/closure-compiler#3189. Drilling into the details, the 3 functions that it's complaining about all fall into category 1 of the below and therefore don't have any unexpected side-effects on their usage. https://262.ecma-international.org/6.0/#sec-block-level-function-declarations-web-legacy-compatibility-semantics The only solution that seems viable at this point in time would be to move these 3 functions outside of the if statement (originally included in the if for performance reasons, so they don't need to be created if the url is mis-configured. As we are planning on some additional snippet changes later this year, I'm going to keep this open as a p3 (because there is no functional issues with the snippet) and however, get allocated to the snippet updates can include this minor change in a future version. For yourself, (in the short term) as I'm thinking you probably want this resolved :-) would be to
;-) |
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I'm having some problems with trying to enable Application Insights via Google Tag Manager (GTM). I have taken the sample snippet from the readme page but am getting errors about ES6 syntax. Below is a screenshot of from GTM:
Here is the snippet I am using:
We currently have the older snippet which works. I have included it below for reference:
Any help would be greatly appreciated.
Thanks Steve
The text was updated successfully, but these errors were encountered: