Ecwid: Difference between revisions
Jump to navigation
Jump to search
Ben.robson (talk | contribs) |
No edit summary |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
On the Ecwid Control Panel: </br> | On the Ecwid Control Panel: </br> | ||
Go to Sales Channels > Website > SEO </br> | Go to Sales Channels > Website > SEO </br> | ||
Edit the Head meta tags & site verification | Edit the "Head meta tags & site verification", then paste GTM here. </br> | ||
== Adding Value Tracking == | |||
Adding Value Tracking | |||
Go to Configuration > Settings > General > Tracking & Analytics </br> | Go to Configuration > Settings > General > Tracking & Analytics </br> | ||
| Line 21: | Line 20: | ||
dataLayer.push({'event' : 'order-submitted'}); | dataLayer.push({'event' : 'order-submitted'}); | ||
</script> | </script> | ||
</pre> | |||
The value will probably drop into Tag Manager formatted as currency (e.g. £120), | |||
so you can use a Custom JS variable to remove this like the below: | |||
<pre> | |||
function() { | |||
return {{Order Value}}.replace(/[£,]/g,""); | |||
} | |||
</pre> | </pre> | ||
Latest revision as of 10:46, 21 May 2021
Tag Manager
On the Ecwid Control Panel:
Go to Sales Channels > Website > SEO
Edit the "Head meta tags & site verification", then paste GTM here.
Adding Value Tracking
Go to Configuration > Settings > General > Tracking & Analytics
Find "Custom tracking code on Order Confirmation page"
If this isn't enabled then enable this & then Edit code.
Add the below:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({'order_id' : '${order.number}'});
dataLayer.push({'order_value' : '${order.total}'});
dataLayer.push({'event' : 'order-submitted'});
</script>
The value will probably drop into Tag Manager formatted as currency (e.g. £120), so you can use a Custom JS variable to remove this like the below:
function() {
return {{Order Value}}.replace(/[£,]/g,"");
}