【发布时间】:2013-10-06 08:16:34
【问题描述】:
是否有机会跟踪点击并从 iframe 获得推荐流量?
我有管视频网站,我的视频嵌入在许多其他网站上,但是当视频嵌入到其他网站上时,无法找到跟踪 iframe 内链接点击的解决方案
这是来自我网站的嵌入代码
<iframe src="http://mysite.com/embed.php?id=4589"></iframe>
我尝试在 embed.php 中放入类似的东西
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-111111-1']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('http:' == document.location.protocol ? 'http://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
然后我更改了指向此的链接
<a href="http://mysite.com/video/55454.html" onclick="_gaq.push(['_link', this.href]);return false;">Continue</a>
但这不是解决方案
【问题讨论】:
标签: javascript php jquery iframe google-analytics