You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @rogersi9, nice code snippet! Saved me some time here to convert the GTM json export to a csv.
I used a json file without any changes exported from GTM, but for some reason there was at least one missing firingTriggerId, instead of an empty array, the export does no set the attribute, therefore throwing the following error on console:
index.js:26 Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
at getTriggerNames (index.js:26:9)
at formatTag (index.js:36:24)
at index.js:50:24
at Array.forEach (<anonymous>)
at gtmToCsv (index.js:49:12)
at reader.onload (index.js:66:23)
As a quick fix, I change the getTriggerNames function to have an empty array for the ids param, as a default, it seems to have worked just fine:
function getTriggerNames(triggers, ids = [])
Opening the issue so if anyone runs into the same problem, maybe it helps.
Thanks again!
The text was updated successfully, but these errors were encountered:
Hey @rogersi9, nice code snippet! Saved me some time here to convert the GTM json export to a csv.
I used a json file without any changes exported from GTM, but for some reason there was at least one missing
firingTriggerId
, instead of an empty array, the export does no set the attribute, therefore throwing the following error on console:As a quick fix, I change the getTriggerNames function to have an empty array for the
ids
param, as a default, it seems to have worked just fine:Opening the issue so if anyone runs into the same problem, maybe it helps.
Thanks again!
The text was updated successfully, but these errors were encountered: