0

In order to track Ecommerce interactions using the Matomo Tag Manager with Data Layers I need to insert this Code as described in the documentation (step 4): https://matomo.org/faq/tag-manager/faq_35847/

window._mtm = window._mtm || [];
window._mtm.push({
'event': 'purchase',
'ecommerce': {
  'purchase': {
    'id': 'dynamic value',
    'revenue': 'dynamic value',
    'orderSubTotal': 'dynamic value',
    'tax': 'dynamic value',
    'shipping': 'dynamic value',
    'discount': 'dynamic value',
    }
  }
});

I have two questions:

  1. Should this code be added to the header of my Wordpress Site?
  2. The "dynamic value" needs to be replaced with the actual values of the commerce interaction. Any chance someone could tell me what to insert?

I'd be very thankful for some hints how to find these values.

Thank you! Cheers Bilal

As I'm not a developer I'm a bit confused. I found some code like "get_id()" but I don't know how to process this.

0 Answers0