如何在 Google Tag Manager 中运行 Google Experiment [英] How to run Google Experiment within Google Tag Manager

查看:23
本文介绍了如何在 Google Tag Manager 中运行 Google Experiment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间以来,我一直试图让它发挥作用,但关于其工作原理的信息似乎很少.

I have been trying to get this to work for sometime and there seems to be very little information on how this works.

首先,我想说我尝试了以下方法来使其正常工作,因此请在发布解决方案之前阅读此内容.

First, I would like to say that I tried the below method to get it working, so please read this before posting a solution.

我的尝试:我在自定义 HTML 块中添加了 google 分析实验代码,并让它仅触发 google 所述的原始页面.这不起作用,似乎为用户创建了一个循环.当用户进入实验页面时,会出现一个白页.

What I tried: I added the google analytics experiment code in a custom HTML block and had it fire only of the original page as stated by google. This doesn't work and seems to create a loop for users. A white page appears when users get to the experiment pages.

有谁知道如何让它工作?非常感谢

Does anyone know how to get this to work? Much appreciated

推荐答案

Google 内容实验的 Javascript 版本目前实际上在 GTM 中不受支持(他们确实做了重定向或动态更改站点,因为它是很难提前说在页面加载期间标签触发的哪一点,以及它的顺序,这不太好用 - 在最好的情况下,原始页面会在访问者被重定向到变体之前完全加载).

The Javascript versions of Google Content Experiments are not actually supported in GTM at the moment (they have do do either redirects or change the site on the fly and since it's hard to say in advance at which point during page load the tags fire, and it which order, this does not work very well - in the very best case the original page would load completely before the visitor is redirected to a variation).

GTM 的功能页面将 A/b 测试标签列为即将推出",但自至少一年前,所以我不会屏住呼吸.

The features page for GTM lists A/b testing tags as "coming soon" but does so since at least a year ago, so I wouldn't hold my breath.

但是你可以做服务器端的变体(你必须实现您自己的逻辑来向每个用户显示适当的变体)并通过 GTM 将实验 ID 和变体编号传递给 GA.我认为没有另一种(可靠的)方法可以做到这一点,至少目前还没有.如果您需要使用 javascript 来完成,您应该将实验脚本添加到页面代码中,而不是通过标签管理来部署它们.

However you can do variations serverside (you'd have to implement your own logic to display the proper variation to each users) and pass and experiment id and the variation number to GA via GTM. I do not think there is another (reliable) way to do this, at least not yet. If you need to do it with javascript you should add the experiment scripts to the page code instead of deploying them via tag managemement.

话虽如此,这里有关于使用 Experiments Javascript API 和一些 jQuery (这里是一个).当谷歌说某些东西不支持"时,这可能只是意味着他们不想测试所有可能的边缘情况并且为了安全而犯错.因此,如果您绝对必须将 GTM 用于内容实验,则您必须测试这样的东西是否适合您.

Having said that, there are descriptions for hacking around the GTM limitations using the Experiments Javascript API and some jQuery (here is one). When Google says that something is "not supported" it might just mean they didn't want to test all possible edge cases and err on the safe side. So you if you absolutely have to use GTM for Content Experiments you would have to test if something like this would work for you.

这篇关于如何在 Google Tag Manager 中运行 Google Experiment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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