<script type="text/javascript">
dataLayer.push({
    "ecommerce": {
        "purchase": {
            "actionField": {
                "id" : "{{transaction.id}}"
            },
            "products": [
            {%for item in items%}
                {
                    "id": "{{item.id}}",
                    "name": "{{item.name|e}}",
                    "price": "{{item.price}}",
                    "brand": "{{item.brand|e}}",
                    "category": "{{item.category|e}}",
                    "variant": "{{item.desc|e}}"
                },
               {%endfor%}
            ]
        }
    }
});

</script>