GoogleTagManager警告:Builder中的意外类型:(null)

时间:2015-06-03 08:50:23

标签: ios google-analytics analytics google-tag-manager

我使用GoogleTagManager实施增强型电子商务(Google Analytics) 我尝试将以下dataLayer推送到GTM。

 [dataLayer push:@{@"event",@"purchase",
                @"ecommerce": @{
                @"purchase": @{
                  @"actionField": @{
                    @"id": @"T12345",                         // Transaction ID. Required for purchases and refunds.
                    @"affiliation": @"Online Store",
                    @"revenue": @"35.43",                     // Total transaction value (incl. tax and shipping)
                    @"tax":"4.90",
                    @"shipping": @"5.99",
                    @"coupon": @"SUMMER_SALE"},
                  @"products": @[                             // List of productFieldObjects.
                    @{@"name": @"Triblend Android T-Shirt",   // Name or ID is required.
                      @"id": @"12345",
                      @"price": @"15.25",
                      @"brand": @"Google",
                      @"category": @"Apparel",
                      @"variant": @"Gray",
                      @"quantity": @1,
                      @"coupon": @""},                        // Optional fields may be omitted or set to empty string.
                    @{@"name": @"Donut Friday Scented T-Shirt",
                      @"id": @"67890",
                      @"price": @"33.75",
                      @"brand": @"Google",
                      @"category": @"Apparel",
                      @"variant": @"Black",
                      @"quantity": @1}]}}}]; 

这是Google代码管理器教程中的示例数据。 但是,在尝试向Google发送匹配时,我收到以下警告消息。

GoogleTagManager warning: Unexpected type in Builder: (null)

我使用的数据类型是NSNumber(价格[doube],收入[双倍]和数量[int])&其他人的NSString。

以上数据类型适用于其他电子商务广告代码,例如“AddToCart”,“Checkout”等。但是“购买”无效..

任何人都可以提出其他可以尝试的建议吗?

1 个答案:

答案 0 :(得分:2)

我曾经遇到过这个问题。它看起来像是与以前的电子商务冲突。

在发送购买活动之前,请尝试清除电子商务对象

[self.tagDataLayer push:@{@"ecommerce":[NSNull null]}];

这对我有用