A
A
Arx7772015-10-16 17:55:52
PHP
Arx777, 2015-10-16 17:55:52

What array structure should be generated so that it is equally transferred to YA and GA?

You need to set up the transfer of e-commerce transactions through Tag Manager YM and GA.
The question is, in what form should the array be generated so that it is equally suitable for both GA and YM
Following the model of YM

dataLayer.push({
    "ecommerce": {
        "purchase": {
            "actionField": {
                "id" : "TRX987",
                "affiliation": "Яндекс.Маркет"
            },
            "products": [
                {
                    "id": "25341",
                    "name": "Толстовка Яндекс мужская",
                    "price": "1345.26",
                    "brand": "Яндекс / Яndex",
                    "category": "Одежда/Мужская одежда/Толстовки и свитшоты",
                    "variant": "Оранжевый цвет"
                },
                {
                    "id": "25314",
                    "name": "Толстовка Яндекс женская",
                    "price": "1543.62",
                    "brand": "Яндекс / Яndex",
                    "category": "Одежда/Женская одежда/Толстовки и свитшоты",
                    "variant": "Белый цвет",
                    "quantity": 3
                }
            ]
        }
    }
});

Or like GA?
<script>
dataLayer = [{
    'transactionId': '1234',
    'transactionAffiliation': 'Acme Clothing',
    'transactionTotal': 38.26,
    'transactionTax': 1.29,
    'transactionShipping': 5,
    'transactionProducts': [{
        'sku': 'DD44',
        'name': 'T-Shirt',
        'category': 'Apparel',
        'price': 11.99,
        'quantity': 1
    },{
        'sku': 'AA1243544',
        'name': 'Socks',
        'category': 'Apparel',
        'price': 9.99,
        'quantity': 2
    }]
}];
</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-10-16
@dimonchik2013

the alignment is this: there was GA, and then Yandex began to support its API, well, similar methods,
and start from this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question