Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pavr0m/c2b7943249a458e511265f1c32f820d3 to your computer and use it in GitHub Desktop.
Save pavr0m/c2b7943249a458e511265f1c32f820d3 to your computer and use it in GitHub Desktop.
{% comment %}
Example of AdWords Purchase conversion tracking code.
Make sure you've already got global AdWords tag installed on the site.
{% endcomment %}
{% if first_time_accessed %}
<!-- Event snippet for Purchase CH conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'XXX', // Paste here a static value you've got while creating the conversion event in AdWords account
'value': '{{ total_price | money_without_currency | remove: "," }}',
'currency': '{{ shop.currency }}',
'transaction_id': '{{ order.order_number }}'
});
</script>
{% endif %}
{% comment %}
Put it on the page that is displayed to the customer
immediately after the order has been accepted by the system
{% endcomment %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment