Find Jobs
Hire Freelancers

Adding Website optimizer javascript into PHP variable

$30-250 USD

已完成
已发布将近 13 年前

$30-250 USD

货到付款
Hi, I like to include a javascript of Google website optimer into a PHP variable which i like to assign with smarty to a template. Here i send you the example code: $optimizer_test = <!-- Google Website Optimizer Control Script --> <script> function utmx_section(){}function utmx(){} (function(){var k='0231920119',d=document,l=[login to view URL],c=[login to view URL];function f(n){ if(c){var i=[login to view URL](n+'=');if(i>-1){var j=[login to view URL](';',i);return escape([login to view URL](i+n. length+1,j<0?[login to view URL]:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=[login to view URL]; [login to view URL]('<sc'+'ript src="'+ 'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.[login to view URL]' +'/[login to view URL]'+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime=' +new Date().valueOf()+(h?'&utmxhash='+escape([login to view URL](1)):'')+ '" type="text/javascript" charset="utf-8"></sc'+'ript>')})(); </script> <!-- End of Google Website Optimizer Control Script --> <!-- Google Website Optimizer Tracking Script --> <script type="text/javascript"> var _gaq = _gaq || []; [login to view URL](['gwo._setAccount', 'UA-3927776-2']); [login to view URL](['gwo._trackPageview', '/0231920119/test']); (function() { var ga = [login to view URL]('script'); [login to view URL] = 'text/javascript'; [login to view URL] = true; [login to view URL] = ('https:' == [login to view URL] ? 'https://ssl' : 'http://www') + '.[login to view URL]'; var s = [login to view URL]('script')[0]; [login to view URL](ga, s); })(); </script> <!-- End of Google Website Optimizer Tracking Script --> Then assign to smarty: $smarty->assign('optimizer_test', $optimizer_test); Then read it in the smarty template: {dynamic}{$optimizer_test}{/dynamic} I als want to do this with the conversion script of google website optimizer: <!-- Google Website Optimizer Tracking Script --> <script type="text/javascript"> var _gaq = _gaq || []; [login to view URL](['gwo._setAccount', 'UA-3927776-2']); [login to view URL](['gwo._trackPageview', '/0231920119/goal']); (function() { var ga = [login to view URL]('script'); [login to view URL] = 'text/javascript'; [login to view URL] = true; [login to view URL] = ('https:' == [login to view URL] ? 'https://ssl' : 'http://www') + '.[login to view URL]'; var s = [login to view URL]('script')[0]; [login to view URL](ga, s); })(); </script> <!-- End of Google Website Optimizer Tracking Script --> But when i use this code i get the follwing error: Parse error: syntax error, unexpected '<' Could you please help fixing this.
项目 ID: 1156225

关于此项目

2提案
远程项目
活跃13 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Think can do this for you!
$30 USD 在0天之内
5.0 (29条评论)
4.6
4.6
2威客以平均价$55 USD来参与此工作竞价
用户头像
Please see PM, thanks.
$80 USD 在0天之内
5.0 (70条评论)
6.3
6.3

关于客户

NETHERLANDS的国旗
Leusden, Netherlands
5.0
24
付款方式已验证
会员自5月 21, 2009起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。