i using googletagmanager implement enhanced e-commerce (google analytics) tried pushing below datalayer gtm.
[datalayer push:@{@"event",@"purchase", @"ecommerce": @{ @"purchase": @{ @"actionfield": @{ @"id": @"t12345", // transaction id. required purchases , refunds. @"affiliation": @"online store", @"revenue": @"35.43", // total transaction value (incl. tax , shipping) @"tax":"4.90", @"shipping": @"5.99", @"coupon": @"summer_sale"}, @"products": @[ // list of productfieldobjects. @{@"name": @"triblend android t-shirt", // name or id required. @"id": @"12345", @"price": @"15.25", @"brand": @"google", @"category": @"apparel", @"variant": @"gray", @"quantity": @1, @"coupon": @""}, // optional fields may omitted or set empty string. @{@"name": @"donut friday scented t-shirt", @"id": @"67890", @"price": @"33.75", @"brand": @"google", @"category": @"apparel", @"variant": @"black", @"quantity": @1}]}}}];
this sample data google tag manager tutorial. following warning message when trying send hits google.
googletagmanager warning: unexpected type in builder: (null)
the data type using nsnumber (price[doube],revenue[double] & quantity[int]) & nsstring others.
the above data-types work proper other ecommerce tags "addtocart","checkout" etc.. "purchase" isn't working..
can 1 suggest else can tried?
i ran problem while back. looks me conflict previous ecommerce stuff.
before u send purchase event, try clearing ecommerce object
[self.tagdatalayer push:@{@"ecommerce":[nsnull null]}];
this worked out me
Comments
Post a Comment