Skip to content

Instantly share code, notes, and snippets.

@matthew6688
Created August 2, 2018 14:00
Show Gist options
  • Save matthew6688/52032a23bc3be91a9c36a2ccafab0741 to your computer and use it in GitHub Desktop.
Save matthew6688/52032a23bc3be91a9c36a2ccafab0741 to your computer and use it in GitHub Desktop.
<script>
window.dataLayer = window.dataLayer || [];
function orderStatus() {
return window.dataLayer.push({
event : 'orderStatus',
totalSpent: "{{ customer.total_spent | times: 0.01 }}",
allOrdersCount: "{{ customer.orders_count }}",
lastOrder: '{{ customer.last_order.created_at | date: "%B %d, %Y" }}'
});}
{% if first_time_accessed %}
orderStatus();
{% else %}
orderStatus();
{% endif %}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment