Open philpott opened 4 years ago
Hi Michael,
Thanks for the suggestions. I've used createQueue as per your second suggestion, code and permissions lost a few lines, that's good.
However we do not want to merge the tags as per your first suggestion for multiple reasons:
As for offering more options in the gtm-wonderpush-integrate tag, in addition to user-friendly checkboxes, we would need to offer an advanced field for the tag integrator to put a raw JSON input to enable him to totally control initialization options.
However I could not find a way to parse a JSON input. Asking permission on JSON
and JSON.parse
is invalid as they are "window built-in variables", but calling them directly in the code doesn't work either because they are undefined.
How could I parse JSON? Do you have another suggestion?
Best, Olivier
Hi @philpott,
Thank you for publishing our tags in the community template gallery.
Do you have any help about how to parse JSON in a GTM template?
However I could not find a way to parse a JSON input. Asking permission on JSON and JSON.parse is invalid as they are "window built-in variables", but calling them directly in the code doesn't work either because they are undefined. How could I parse JSON? Do you have another suggestion?
Best, Olivier
I checked with my team and we currently don't support parsing JSON but we do have a backlog of API's that we would like to submit that I can add this to. Could you give me a use case for a JSON parsing API that I can add to the backlog so we can prioritize work.
Thanks Michael
On Sat, Dec 14, 2019, 3:01 AM Olivier Favre notifications@github.com wrote:
Hi @philpott https://github.com/philpott,
Thank you for publishing our tags in the community template gallery.
Do you have any help about how to parse JSON in a GTM template?
However I could not find a way to parse a JSON input. Asking permission on JSON and JSON.parse is invalid as they are "window built-in variables", but calling them directly in the code doesn't work either because they are undefined. How could I parse JSON? Do you have another suggestion?
Best, Olivier
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wonderpush/gtm-wonderpush-trackevent/issues/1?email_source=notifications&email_token=ACZ2WWL3ELELDEJAFWP7XVLQYS4JJA5CNFSM4JW36KB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4ACAA#issuecomment-565707008, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ2WWJFO7VTGD35NECFC7DQYS4JJANCNFSM4JW36KBQ .
Hi @philpott,
Our SDK supports several initialization parameters, given as a JavaScript object. Some values accept nested objects. The typing of values is important.
We can provide a UI that breaks down the most important of these options into something easy for the user, but it would never match the flexibility of providing your own JSON value.
Best, Olivier
Couple suggestions for the set of tags submitted...
It would be a simpler user experience if you combine the inject script call into both of your core templates (tagging and track event). The way it's currently implemented the user will have to manually guarantee that the install tag by hand or using a tag sequence on all WonderPush tagging and track event calls.
If you wanted to you could use copyFromWindow to verify if the object exists before sending the injectScript request.
You can use createQueue or createArgumentsQueue to bind to your array. This will simplify the code but is equivalent to what is currently implemented with setInWindow/callInWindow.
Thanks Michael