我在Google跟踪代码管理器中的变量定义出了什么问题?

问题描述 投票:-1回答:2

我已将一些值推送到dataLayer中,如下所示,我在Google跟踪代码管理器调试控制台上将它们保存了:

enter image description here

我已经定义了一个自定义javascript变量,如下所示:

function() {
    var dest;
    dest = google_tag_manager[{{Container 
    ID}}].dataLayer.get("DestinationLocation").fromLocation;
    return dest;
 }

但是仍然,它在变量列表中是未定义的。

enter image description here

javascript google-tag-manager google-datalayer
2个回答
1
投票
您正在尝试获取对标签管理器对象的引用,尽管该方法在标签中起作用,但在变量中不起作用。

0
投票
在您的情况下,[[DestinationLocation
© www.soinside.com 2019 - 2024. All rights reserved.