Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //HTML Block
- <div style="display: block;" id="ondeposit-event" data-all='{"data":{"status":"WAITING_APPROVAL","payload":{"txRefId":"587457656", "method":"withdrawal","amount":"-14.00 EUR","txAmount":"-14.00","txAmountCy":"EUR","fee":"0.00","pspReferenceId":"","psp": "SafeCharge","accountId":"19f7b136-247c-45c","pspAccount":"Withdraw","success":true,"merchantTxId":"14409134890"}}}' data-success="success">Hello world</div>
- //GTM Custom JS Varibale to access "Amount" inside the JSON at data-all attribute
- function() {
- var all = document.querySelector('#ondeposit-event').getAttribute('data-all');
- all = JSON.parse(all);
- return all.data.payload.amount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement