如何在Google跟踪代码管理器中运行Google实验 [英] How to run Google Experiment within Google Tag Manager

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

问题描述

我一直试图让这个工作一段时间,似乎很少有关于这个工作的信息。



首先,我想说的是我尝试了下面的方法来让它工作,所以请在发布解决方案之前阅读此内容。



我尝试过的方法:
I谷歌分析实验代码添加到自定义HTML块中,并使其仅触发原始页面,如google所述。这不起作用,似乎为用户创建一个循环。当用户进入实验页面时会出现白页。

有谁知道如何让这个工作起作用?非常感谢

解决方案

目前,Google内容实验的Javascript版本实际上并不支持GTM(他们的确有做重定向或者动态地改变网站,因为很难预先说明在页面加载过程中的哪一点,标签会触发,而且它的顺序,这不能很好地工作 - 在最好的情况下,原始页面会在访问者被重定向到变体)。



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



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



话虽如此,围绕GTM限制使用实验Javascript API和一些jQuery(这里是一个)。当Google说某件事情不被支持时,这可能意味着他们不想测试所有可能的边缘案例,并且在安全方面犯错。因此,如果您绝对必须使用GTM进行内容实验,您将不得不测试这样的事情是否适合您。

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.

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

解决方案

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).

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.

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.

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跟踪代码管理器中运行Google实验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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