PHP A / B拆分Google优化器for WordPress(过滤器挂钩)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP A / B拆分Google优化器for WordPress(过滤器挂钩)相关的知识,希望对你有一定的参考价值。

//Custom Headers for A/B Split Landing Pages
function insert_splittest_header() {
if (is_page(8582)) { ?>
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='0785944995',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return escape(c.substring(i+n.
length+1,j<0?c.length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script><script>utmx("url",'A/B');</script>
<!-- End of Google Website Optimizer Control Script -->
<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['gwo._setAccount', 'UA-23025259-1']);
  _gaq.push(['gwo._trackPageview', '/0785944995/test']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
<!-- End of Google Website Optimizer Tracking Script -->

<?php } }
add_action('wp_head','insert_splittest_header',0);


// Customer Footer for final page - the 'thank you'
function insert_B_footer () {
if (is_page(9161)) { ?>
<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['gwo._setAccount', 'UA-23025259-1']);
  _gaq.push(['gwo._trackPageview', '/0785944995/test']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
<!-- End of Google Website Optimizer Tracking Script -->
<?php } }
add_action('wp_footer','insert_B_footer');

以上是关于PHP A / B拆分Google优化器for WordPress(过滤器挂钩)的主要内容,如果未能解决你的问题,请参考以下文章

循环拆分使代码变慢

四边形不等式优化DP

[Google Guava]字符串处理:连接器拆分器字符匹配器

【帮帮我】PHP中如何拆分“abc中文”,如何拆成 a、b、c、中、文

动态规划之四边形不等式优化

怎么用python把一个txt的内容拆分成多个txt内容。拆分条件:遇到//生成新txt