문제

I'm trying to send e-commerce transactions from my iOS app using google tag manager like described here

Now I can see transactions in the conversions > e-commerce > overview panel in google analytics but all the items have a quantity of 0.

I'm making a NSMutableDictionary for the items like so:

for (CartItem *item in cart.items) {

    [transaction[@"transactionProducts"] addObject:@{@"name": item.productName,
                                                     @"sku": item.reference,
                                                     @"category": @"mobile",
                                                     @"price": item.shopPrice,
                                                     @"currency": @"EUR",
                                                     @"quantity": item.quantity}];
}

item.quantity is a NSNumber

In analytics I can see the name, sku, category, price but NOT the quantity.

Am I doing anything wrong ?

EDIT:

I enabled verbose logging in the GA library so I'm able to see everything that's sent to analytics. For instance, I made a transaction with an item with quantity = 1.

In the logs I can see :

2014-03-21 08:51:35.948 MyApp[86287:5207] GoogleTagManager verbose: GoogleAnalytics 3.03 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:418): Saved hit: {
parameters =     {
    "&_u" = ".7nL";
    "&_v" = "mi3.0.3";
    "&an" = "MyApp";
    "&av" = "3.2";
    "&cid" = "c5ae7a50-dc25-4c17-b706-e509af250ab7";
    "&cu" = EUR;
    "&sr" = 320x480;
    "&t" = transaction;
    "&ta" = 3240;
    "&ti" = "6753864 - 3240";
    "&tid" = "UA-XXXXXXX-X";
    "&tr" = "18.93";
    "&ts" = 0;
    "&tt" = "3.98";
    "&ul" = en;
    "&v" = 1;
    "&z" = 9238494410774743125;
    gaiVersion = "3.03";
};
timestamp = "2014-03-21 07:51:35 +0000";

}

2014-03-21 08:51:35.950 MyApp[86287:5207] GoogleTagManager verbose: GoogleAnalytics 3.03 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:418): Saved hit: {
parameters =     {
    "&_u" = ".L";
    "&_v" = "mi3.0.3";
    "&an" = "MyApp";
    "&av" = "3.2";
    "&cid" = "c5ae7a50-dc25-4c17-b706-e509af250ab7";
    "&cu" = EUR;
    "&ic" = "14192_27P";
    "&in" = "SLIPPERS \"RETRO FLIP\" - ZWART";
    "&ip" = "18.93";
    "&iq" = 1;
    "&iv" = mobile;
    "&sr" = 320x480;
    "&t" = item;
    "&ti" = "6753864 - 3240";
    "&tid" = "UA-XXXXXXX-X";
    "&ul" = en;
    "&v" = 1;
    "&z" = 9238494410774743126;
    gaiVersion = "3.03";
};
timestamp = "2014-03-21 07:51:35 +0000";

}

I can also see that the dispatch works.

도움이 되었습니까?

해결책 2

This issue was due to a bug in the library and has been fixed in the version 3.0.7 of the SDK

Changelog: https://developers.google.com/analytics/devguides/collection/ios/changelog

More info: https://productforums.google.com/forum/#!msg/tag-manager/WeiueEi4JDk/ofgq6s1tw30J

다른 팁

I'm unable to reproduce the problem on my end.

Can you post the entire set of parameters that are being sent in the GA hit in order to help me diagnose the problem?

Neil Google Tag Manager for Mobile Apps Tech Lead

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top