使用GTM电子商务增强功能和dataLayer推送功能跟踪ajax步骤 [英] Checkout ajax steps tracked with GTM ecommerce enhanced and dataLayer push

查看:1465
本文介绍了使用GTM电子商务增强功能和dataLayer推送功能跟踪ajax步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在单个页面中结帐,每个步骤都通过Google Analytics帐户进行调用。 ajax请求,所以我已经为每个步骤添加了dataLayer.push功能,当然还包括步骤号。



现在我无法捕捉任何东西漏斗显示在谷歌分析。



我谈论的漏斗是转换 - >电子商务 - >购物分析中的结帐行为分析 p>

我使用的电子商务代码是GTM,我在加载结帐页时将dataLayer结帐事件推送到每个结帐ajax步骤的checkoutOption事件。
一旦这些事件被推送到GTM上的dataLayer,我已经在事件上设置了标记激活器,以便将信息传递到谷歌分析,并使用具有事件功能的通用分析标记(而不是综合浏览量)。



我推送的ajax事件的代码如下。

结帐开始:

  dataLayer.push({
event:checkout,
ecommerce:{
checkout_option: {
actionField:{step:1,option:},
products:self.datas [checkout_items]
}
}
});

结帐帐单地址

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{ step:2,option:}
}
}
});

结帐送货地址

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{ step:3,option:}
}
}
});

结帐运送方式

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{ step:4,option:self.datas [shipping_method]}
}
}
});

结帐付款方式

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{ step:5,option:self.datas [payment_method]}
}
}
});

结帐优惠券

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{步骤:6,option:self.datas [couponcode]}
}
}
});

签出地点顺序

  dataLayer.push({
event:checkoutOption,
ecommerce:{
checkout_option:{
actionField:{ step:7,option:}
}
}
});

我已阅读所有增强的指南,例如:



还有更多我错过的东西吗?



最好。
Francesco。

解决方案

确保您已配置标签(无论是浏览量还是事件) dataLayer对象,每当你有一个结帐事件。您需要在高级设置下检查启用增强型电子商务功能以及使用数据层



编辑:
checkout_option 字段仅用于需要提供补充例如,如果您希望将付款方式添加到付款页面中,您可以将结算信息添加到结帐步骤。



结帐渠道中的每个结帐步骤都需要添加如下内容:

  //步骤1 
dataLayer.push({
'event':'checkout start',
'ecommerce':{
'checkout':{
'actionField':{'step':1,'option':'Visa'},
'products': // ....产品
}
}

//步骤2
dataLayer.push({
'event':'checkout billing' ,
'ecommerce':{
'checkout':{
'actionField':{'step':2},
'products'://。 ...产品
}
}

等。



所以你实际上并没有用你目前的步骤发送任何信息。


I'm wondering on how to tracks checkout and checkout steps events on google analytics.

I've a checkout in a single page and each steps is called via ajax requests, so I've already add the "dataLayer.push" functionality for each steps, bringing of course the step number in it.

Now I cannot catch anything on the funnel shown up on google analytics.

The funnel I'm talking about is the "Checkout Behavior Analysis" inside the Conversion -> Ecommerce -> Shopping Analysis.

The ecommerce code I'm using is the GTM one by pushing on dataLayer the checkout event when I'm loading the checkout page, and the checkoutOption event for each checkout ajax step. Once those events are pushed to the dataLayer on GTM I've set up the tag activator on the events to pass the information to google analytics with the universal analytics tag with event feature (not a pageview).

The codes for ajax events I'm pushing are the following.

Checkout Start:

dataLayer.push({
    "event": "checkout",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 1, "option": ""},
            "products": self.datas["checkout_items"]
        }
     }
});

Checkout Billing Address

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 2, "option": ""}
        }
    }
});    

Checkout Shipping Address

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 3, "option": ""}
        }
    }
});    

Checkout Shipping Method

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 4, "option": self.datas["shipping_method"] }
        }
    }
});

Checkout Payment Method

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 5, "option": self.datas["payment_method"] }
        }
    }
});

Checkout Coupon

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 6, "option": self.datas["couponcode"] }
        }
    }
});

Checkout Place Order

dataLayer.push({
    "event": "checkoutOption",
    "ecommerce": {
        "checkout_option": {
            "actionField": {"step": 7, "option": "" }
        }
    }
});

I've read all the enhanced guides like:

Is there something more I'm missing?

Best. Francesco.

解决方案

Make sure that you have configured your tag (whether it's a pageview or event) to read in the dataLayer object whenever you have a checkout event. You would need to check the Enable Enhanced Ecommerce Features and also the Use Data Layer under the Advanced Settings.

Edit: The checkout_option field is only used when you need to provide supplemental information to a checkout step, for example if you want to add a payment method to the payment page.

Each checkout step in your checkout funnel needs to be added like this:

// Step 1
dataLayer.push({
   'event': 'checkout start',
   'ecommerce': {
      'checkout': {
         'actionField': {'step': 1, 'option': 'Visa'},
         'products': // .... products
    }
}

// Step 2
dataLayer.push({
   'event': 'checkout billing',
   'ecommerce': {
      'checkout': {
         'actionField': {'step': 2},
         'products': // .... products
    }
}

etc.

So you aren't actually sending any information for your steps with what you currently have.

这篇关于使用GTM电子商务增强功能和dataLayer推送功能跟踪ajax步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆