Personalized checkout and custom promotions with Shopify Scripts
Hello,
I'm trying to add this script to a blog post so that when a user lands on this page, these event values are pushed to the dataLayer.
Here is the script :
{% if page.url == "/blogs/news/login-page" %}
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'login',
'customerType': 'regular',
'registrationCountry': 'France'
});
</script>
{% endif %}
However, nothing is apparent in the dataLayer. I put this script in theme.liquid.
Could you help me please?
Thanks
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025