简体   繁体   English

为什么 Google Analytics 报告中没有记录结帐步骤?

[英]Why checkout step not recorded in the Google Analytics report?

I'm making an enhanched ecommerce tracking with google analytics.我正在使用谷歌分析进行增强的电子商务跟踪。 I'm following the existing implementation in gtag.js.我正在关注 gtag.js 中的现有实现。 I have 4 checkout steps including shipping method data, payment method data, pending payment, and also paid (purchase).我有 4 个结帐步骤,包括运输方式数据、付款方式数据、待付款以及已付款(购买)。 I've made the codes for each step below:我已经为下面的每个步骤制作了代码:

1. Shipping Method 1. 运送方式

<script>
    gtag('event', 'set_checkout_option', {
        "checkout_step": 1,
        "checkout_option": "shipping method",
        "value": ""
    });
</script>

2. Payment Method 2. 付款方式

<script>
    gtag('event', 'set_checkout_option', {
        "checkout_step": 2,
        "checkout_option": "payment method",
        "value": ""
    });
</script>

3. Pending Payment 3. 待付款

$("#order-now-action").on('click', function() {
    gtag('event', 'set_checkout_option', {
        "checkout_step": 3,
        "checkout_option": "pending",
        "id": ""
    });
})

This is the checkout funnel that I created in Ecommerce Settings.这是我在电子商务设置中创建的结帐漏斗。 在此处输入图片说明

And this is a report in the checkout behavior menu.这是结帐行为菜单中的报告。 The shipping method is recorded, but why in step 2 (payment method) to step 4 (purchase) is it not recorded?运输方式被记录了,但是为什么在步骤2(付款方式)到步骤4(购买)中没有记录? 在此处输入图片说明

even though, in the sales performance menu, the transaction is recorded?即使,在销售业绩菜单中,交易记录? 在此处输入图片说明

for steps 1-3 is in 1 page, while the purchase (step 4) I did on the backend using a single url.步骤 1-3 在 1 页中,而购买(步骤 4)我在后端使用单个 url 进行。 Is it because it's on 1 page so it's not recorded?是因为它在 1 页上所以没有记录吗?

Generally, your setup looks fine.通常,您的设置看起来不错。 I would, however, suggest to do it as shown in Google's documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce但是,我建议按照 Google 的文档中所示进行操作: https : //developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

 function onShippingComplete(stepNumber, shippingOption) { ga('ec:setAction', 'checkout_option', { 'step': stepNumber, 'option': shippingOption }); ga('send', 'event', 'Checkout', 'Option', { hitCallback: function() { // Advance to next page. } }); }

But let's debug:但是让我们调试一下:

  1. Either in the Network tab, or through a debugger extension like adswerve's, make sure you're actually sending the calls to the collect endpoint.无论是在网络选项卡中,还是通过诸如 adswerve 之类的调试器扩展,请确保您确实将调用发送到collect端点。 Go through the checkout funnel, trigger the events and inspect them.通过结帐漏斗,触发事件并检查它们。 Pay attention to the property id (it's in the tid field of the payload sent to google's collect endpoint)注意属性 id(它在发送到谷歌收集端点的有效负载的 tid 字段中)

  2. Make sure you're generating reports on the data that has been fully processed by GA, so at least 2-day-old data for non-360 accounts and at least 4 hour-old for 360.确保您生成的数据已由 GA 完全处理,因此非 360 帐户的数据至少为 2 天,360 的数据至少为 4 小时。

  3. Make sure your session is not broken between the first step and the actual purchase.确保您的会话在第一步和实际购买之间没有中断。 For this, you either have to use the user explorer and actually see where the checkout session breaks for a specific client id.为此,您必须使用用户资源管理器并实际查看特定客户端 ID 的结帐会话在哪里中断。 Or track a session id in a custom dimension and see that you can see all the checkout events when inspecting specific session id in a custom report.或者在自定义维度中跟踪会话 ID,并在检查自定义报告中的特定会话 ID 时看到您可以看到所有结帐事件。 Session breakage often occurs when the source changes, or when the user id consistency breaks.会话中断通常发生在源更改或用户 ID 一致性中断时。 A good real life example for it would be shopify's checkout being on a different TLD.一个很好的现实生活示例是 shopify 的结帐位于不同的 TLD 上。

  4. Make sure you're looking at an unfiltered view just to exclude the possibility of filters interfering with the data and deleting your events.确保您查看的是未过滤的视图,只是为了排除过滤器干扰数据和删除事件的可能性。

I'm very confused in solving this problem but I found the right answer why my checkout step is not recorded.我在解决这个问题时很困惑,但我找到了正确的答案,为什么我的结账步骤没有被记录下来。 This happened because set_checkout_option could not be used multiple times in one page, so I replaced it with the checkout_progress event.发生这种情况是因为set_checkout_option不能在一个页面中多次使用,所以我用checkout_progress事件替换了它。 Because as in this Measure checkout steps documentation, To measure each subsequent checkout step, send a checkout_progress .因为在这个测量结帐步骤文档中,要测量每个后续结帐步骤,请发送checkout_progress I also modified my code a bit to be like this:我还稍微修改了我的代码,如下所示:

1.Shipping Method 1.发货方式

<script>
    function checkoutProgressShippingMethodGA() {
        gtag('event', 'checkout_progress', {
            "checkout_step": 1,
            "checkout_option": "Shipping Method",
            "value": ""
        });
    }
    checkoutProgressShippingMethodGA();
</script>

2.Payment Method 2.付款方式

<script>
    function checkoutProgressPaymentMethodGA() {
        gtag('event', 'checkout_progress', {
            "checkout_step": 2,
            "checkout_option": "Payment Method",
            "value": ""
        });
    }
    checkoutProgressPaymentMethodGA();
</script>

and tadaaaa... my checkout step has been recorded (**purchase has not been recorded because I have not implemented it on the backend)和tadaaaa...我的结帐步骤已记录(**购买尚未记录,因为我没有在后端实现它) 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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