JSFiddle - React, Tailwind, and code Playground
by m4xout
HTML
Yay!
Thanks for your order, we are so grateful.
Love Becca + Jess
<script>
var enhanced_conversion_data = {
"first_name": "{{ checkout.billing_address.first_name }}",
"last_name": "{{ checkout.billing_address.last_name }}",
"home_address": {
"street": "{{ checkout.billing_address.street }}",
"city": "{{ checkout.billing_address.city }}",
"region": "{{ checkout.billing_address.province }}",
"postal_code": "{{ checkout.billing_address.zip }}",
"country": "{{ checkout.billing_address.country_code }}"
}
}
if("{{ checkout.email }}"){
enhanced_conversion_data.email = "{{ checkout.email }}";
}
if("{{ checkout.billing_address.phone }}"){
enhanced_conversion_data.phone_number = "{{ checkout.billing_address.phone }}";
}
</script>
<!-- Global site tag (gtag.js) - Google Ads: 810151351 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-810151351"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-810151351', {'allow_enhanced_conversions': true});
</script>
{% if first_time_accessed %}
<script>
gtag('event', 'conversion', {
'send_to': 'AW-810151351/X5xzCK_T984BELfbp4ID',
'value': {{ checkout.total_price | divided_by: 100.0 }},
'currency': '{{ currency }}',
'transaction_id': '{{ order_number }}',
});
</script>
{% endif %}