googleanalytics / ecommerce-migration-helper

Apache License 2.0
12 stars 11 forks source link

Category mistyped #6

Open iagowp opened 1 year ago

iagowp commented 1 year ago

When I send this:

{
      "transaction_id": "09erdxiojaoidw0e9",
      "affiliation": "Frutacor",
      "value": 78,
      "currency": "BRL",
      "shipping": 18,
      "items": [{
        "id": "product['_id']",
        "name": "product.name",
        "category": "product.category.name",
        "quantity": 1,
        "price": 60
       }]
    }

It suggests me this

gtag('event', 'purchase', {
  'transaction_id': '09erdxiojaoidw0e9',
  'affiliation': 'Frutacor',
  'value': '78',
  'shipping': '18',
  'items': [
    {
      'item_id: 'product%5B%27_id%27%5D',
      'item_name: 'product.name',
      'item_cateogry: 'product.category.name',
      'quantity: '1',
      'price: '60',
    },
  ],
});

item_category is spelled as item_cateogry. Also, the documentation shows affiliation should be at item level, not purchase level