I have implemented the Bronto Tag Manager to track cart details successfully.
After including the Bronto Commerce JavaScript snippet on my page, I am now able to create the bronto.sca object.
While bronto.sca.config() and bronto.sca.id are returning values as expected, unfortunately, bronto.sca.cart always returns null.
Below is the code snippet that I am currently using:
<script type="text/javascript">
$("#Run").click(function()
{
alert('Run clicked');
debugger();
bronto.init;
var brontoCart = {
"cartPhase": "ORDER_REVIEW",
"currency": "USD",
"subtotal": 990.00,
"discountAmount": 0,
"taxAmount": 110.00,
"grandTotal": 880.00,
"orderId": "1331",
"emailAddress": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eea881819a8b9cae9f998bc09881">[email protected]</a>",
"cartUrl": "http://localhost:5000/cart#view",
"lineItems": new Array()
};
bronto.sca.addToCart(brontoCart);
});
</script>
<script data-name="__br_tm" type="text/javascript">
var _bsw = _bsw || [];
_bsw.push(['_bswId', 'xxxxxxxxxxxxxx']);
(function() {
var bsw = document.createElement('script');
bsw.type ='text/javascript';
bsw.async = true;
bsw.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'js.bronto.com/c/********************/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/s/b.min.js';
var t = document.getElementsByTagName('script')[0];
t.parentNode.insertBefore(bsw, t);
})();
I also need guidance on how to incorporate the Bronto JSON into a webpage effectively.