<script>
//
window.dataLayer = window.dataLayer || [];
//
{% if dataLayer is defined %}{% for key, value in dataLayer %}
{% if key is numeric %}
dataLayer.push({{ value | json_encode | raw }});
{% else %}
dataLayer.push({"{{ key }}": {{ value | json_encode | raw }}});
{% endif %}
{% endfor %}{% endif %}
</script>
<script type="text/javascript" src="https://static.criteo.net/js/ecp_solutions/crto_sha256.js"></script>
<script type="text/javascript">
{% if app.user is not empty and app.user.email is not empty %}
if (Array.isArray(dataLayer)) {
dataLayer.push({
gtm_customer: {
customer_email_hashed: crto_sha256("{{ app.user.email }}"),
},
});
}
{% endif %}
</script>