简体   繁体   English

使用Tag Manager进行的电子商务跟踪显示在dataLayer中,但在Analytics(分析)中不显示

[英]eCommerce Tracking With Tag Manager Showing in dataLayer but no in Analytics

I have setup a test page here http://thiswebguy.com/wrdtest/transaction-thanks.html which uses the example code found on the GTM help section. 我在这里http://thiswebguy.com/wrdtest/transaction-thanks.html设置了一个测试页面,该页面使用GTM帮助部分中的示例代码。

I have checked the console and the product data is in the dataLayer, I have also used GADebugger and it says that the product has been sent to Analytics 'Tacking Beacon Sent' (it also lists the products and transaction info). 我已经检查了控制台,并且产品数据在dataLayer中,我还使用了GADebugger,它说该产品已发送到Analytics(分析)“ Tacking Beacon Sent”(已列出发送的信标)(还列出了产品和交易信息)。

So I would assume that it would work and begin to show in Analytics.... But it's not! 因此,我认为它会起作用并开始在Analytics(分析)中显示。...但这不是!

I have added the event trackTransaction to the beginning: 我已经将事件trackTransaction添加到开头:

'event': 'trackTransaction',

This isn't in the Google docs but it didn't work without it, and although it still doesn't now all the data is still showing in the dataLayer and GA Debugger. 这不是Google文档中的内容,但是没有它就无法工作,尽管现在仍然没有,但所有数据仍显示在dataLayer和GA Debugger中。

I have two rules which fires when the event 'trackTransaction' is triggered; 我有两个规则在触发“ trackTransaction”事件时触发; and to only fire once the dom is loaded. 并且仅在dom加载后才触发。

In my previous setup I had two tags also one was the 'only fire when dom is loaded' tag and the other was fire only on the thank you page - but it gave me the same results as using the event. 在我之前的设置中,我有两个标签,一个是“加载dom时仅触发”标签,另一个仅在“谢谢”页面上触发-但这给了我与使用该事件相同的结果。

I've waited two days for the data to show by the way. 我已经等了两天了,数据才顺便显示出来。

Any help would be appreciated! 任何帮助,将不胜感激!

You're placing the dataLayer object in the <body> . 您要将dataLayer对象放置在<body> Try moving it to the <head> and removing your 'event':'trackTransaction' , and just have set your rule to fire on the {{url}} equals /thank-you-page. 尝试将其移至<head>并删除'event':'trackTransaction' ,然后将规则设置为在{{url}}等于/ thank-you-page上触发。

<html>
<head>
<script>
dataLayer = [{
    'transactionId': '1234',
    'transactionAffiliation': 'Acme Clothing',
    'transactionTotal': '11.99',
    'transactionTax': '1.29',
    'transactionShipping': '5',
    'transactionProducts': [{
        'sku': 'DD44',
        'name': 'Test Prod',
        'category': 'Apparel',
        'price': '11.99',
        'quantity': '1'
    },{
        'sku': 'AA1243544',
        'name': 'Test Prod Again',
        'category': 'Apparel',
        'price': '9.99',
        'quantity': '2'
    }]
}];
</script>
</head>
<body>
<!-- GTM Container Code -->
</body>
</html>

Ok I found out why, you actually need to type: dataLayer into the console. 好的,我知道了为什么,您实际上需要在控制台中键入:dataLayer。

Thanks for the help! 谢谢您的帮助!

暂无
暂无

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

相关问题 使用Google Tag Manager电子商务跟踪到Analytics(分析) - Tracking with Google Tag Manager Ecommerce to Analytics 带有数据层的 Google Analytics 增强型电子商务 - 跟踪代码管理器中的哪些事件? - Google Analytics Enhanced Ecommerce with datalayer - which events in Tag Manager? “ dataLayer.push”或使用“ dataLayer =”声明以用于Google Analytics(分析)电子商务跟踪GTM - “dataLayer.push” or declare with “dataLayer =” for Analytics Ecommerce Tracking GTM 通过标签管理器跟踪谷歌分析电子商务中的折扣值 - Discount values in google analytics ecommerce tracking via tag manager 使用跟踪代码管理器的分析中未显示增强型电子商务数据 - Enhanced Ecommerce data not showing up in Analytics using Tag Manager 使用 Google Tag Manager 在 Google Analytics 中进行跟踪时在 dataLayer 中使用自定义维度 - Using Custom Dimensions in the dataLayer when using Google Tag Manager for tracking inside Google Analytics GTM和增强型电子商务。 没有显示在Google Analytics(分析)中-为DataLayer抓取DOM - GTM and Enhanced Ecommerce. Not showing in Analytics - Scraping DOM for DataLayer Google跟踪代码管理器中的电子商务跟踪问题 - eCommerce Tracking Issues in google tag manager 通过Google跟踪代码管理器进行电子商务跟踪 - Ecommerce Tracking via Google Tag Manager Google跟踪代码管理器未将电子商务数据发送到Google Analytics(分析) - Google Tag Manager Not Sending Ecommerce Data to Analytics
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM