简体   繁体   中英

Google Analytics Ecommerce Tracking is not working

I'm using Google Tag Manager to implement Google Analytics. I couldn't be able to have e-commerce data. I'm sending the ecommerce data within the dataLayer object:

dataLayer = dataLayer || [];
dataLayer.push({
    PageType: "Confirmation",
    ProductID: "2222",
    ProductGroup: "",
    ProductName: "Test1",
    CheckInDate: "2017-09-10",
    CheckOutDate: "2017-09-11",
    NumberOfAdults: "2",
    NumberOfChildren: "0",
    NumberOfRooms: "1",
    NumberOfNights: "1",
    TransactionID: "11111",
    Revenue: 60.00,
    Destination: "London",
    Event: "Purchase",
    'transactionId': "11111",
    'transactionAffiliation': "Test1",
    'transactionTotal': 60.00,
    'transactionProducts': [{
        'sku': '2222',
        'name': 'Test1',
        'category': 'Hostel',
        'price': 60.00,
        'quantity': 1,
    }]
});

This object is created before tag manager snippet.

In Google Tag Manager I have only one tag that fires all pages and track type is Page View. I didn't add another tag for transaction since the object occurs before snippet. Enhanced Ecommerce Features is not enabled (I tried when it's enabled but didn't change anything.

In Google Analytics I have enabled Ecommerce but Enhanced Ecommerce.

Dimensions that I have except ecommerce are mapped but ecommerce variables are not.

What should I do to make ecommerce work properly? What do I missing?

The code works properly with the configuration. What you have to do is create the tag of transaction, this because the dataLayer used is for standard ecommerce and with that technology the transaction hit is send separated. (In Enhance ecommerce this info is send on attached to another hit).

So in this case doesn't matter if the data is pushed before or after the pageview, because is sent with their own trigger.

Greetings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM