Conectando G4 a cuenta estándar de Shopify

septiembre 18, 2022 1 lectura mínima

Conectando G4 a cuenta estándar de Shopify

¿Buscando como conectar tu cuenta de Shopify a G4? ¡Aquí te traemos un video!

 ¡Te dejamos el código!

 

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-TU CODIGO"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-TU CODIGO');
{% if first_time_accessed %}
gtag('event', 'purchase', {
"transaction_id": "{{order.order_number}}",
"value": {{total_price | times: 0.01}},
"currency": "{{ order.currency }}",
"tax": {{tax_price | times: 0.01}},
"shipping": {{shipping_price | times: 0.01}},
"items": [
{% for line_item in line_items %}{
"id": "{{line_item.product_id}}",
"name": "{{line_item.title}}",
"quantity": {{line_item.quantity}},
"price": {{line_item.line_price | times: 0.01}}
},{% endfor %}
]
});
{% endif %}
</script>


Dejar un comentario