3

我正在做一个项目,我将分析集成到一个网站中。我对使用本文中描述的数据层非常感兴趣,

https://developers.google.com/tag-manager/devguide

但是,本教程仅定义了在使用 Google Tag Manager 时如何使用数据层。如果我使用不同的标签管理器,例如 BrightTag 或 OpenTag,是否可以仅使用 JavaScript 将 Google Analytics 连接到数据层?

谢谢!DS

4

2 回答 2

2

OpenTag has it's own specification for a data layer - they call it "universal variable", specs are here: https://github.com/QubitProducts/UniversalVariable. Presumably BrightTag uses yet another format

Updated to add: Brighttag is now Signal and they do not seem to use a standardized format, they simply grab global variables - but of course you still can declare an object to create a pseudo-namespace and minimize naming collisions, and pick your values from that object

There seems to be no commom specification which would be compatible with multiple/all Tag Management Systems.

So yes, you can use some kind of data layer with other Tag Management Systems but it might be called differently and how it will be implemented depends on your platform of choice.

Updated to add: Also keep in mind that the GTM dataLayer does not just contain key/value pairs, the GTM code also overwrites the native push method for the dataLayer array. That might be a concern if you plan to use multiple tools that manipulate the dataLayer variable at once.

于 2013-05-28T09:43:08.587 回答
1

通常,标签管理器允许对您的数据层变量进行完全自定义。至少谷歌标签管理器允许你重命名它:https ://developers.google.com/tag-manager/devguide#renaming 。如果其他供应商是明智的,他们可能也会允许这样做——以防变量名冲突。

没有跨标签管理器使用的通用标准,但 W3C 正在制定标准数据层的提案草案。值得一试:

http://www.w3.org/community/custexpdata/

据推测,如果您遵循这一点,将来应该更容易切换到其他标签管理器。

于 2013-07-01T00:30:26.583 回答