Why are tags stripped out on one site, but not another?
-
Hi,
I have read the explanation about why certain HTML (like <script>) won’t work on WordPress at http://en.support.wordpress.com/code/. Sort of makes sense.
What I can’t figure out is how come my Google Analytics tracking code works OK on site A below, but the <script> tags are stripped out on site B below.
I’m guessing the sites are different somehow, but I can’t figure out if it is something I can change to enable the HTML on site B.
Is it the difference between the self-hosted version available at WordPress.org (A) and the fully hosted WordPress.com (B)? Any suggestions?
I would really like to use the industry standard Google Analytics to track visitors to site B. Thanks.
Gary Coon
A.) http://elsonlawfirm.com/team/
<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-40550753-1’, ‘elsonlawfirm.com’);
ga(‘send’, ‘pageview’);</script>
B.) http://garycoon.wordpress.com/test/
<script>(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-44209913-1’, ‘wordpress.com’);
ga(‘send’, ‘pageview’);</script>
The blog I need help with is: (visible only to logged in users)
-
Is it the difference between the self-hosted version available at WordPress.org (A) and the fully hosted WordPress.com (B)? Any suggestions?
The reason why it is not working on site B is that we do not allow embedded code of that nature on WordPress.com for security reasons. Please see:
http://en.support.wordpress.com/code/We do have our own site stats on WordPress.com that may be useful:
-
Thanks, saw the code explanation already, so not surprised. I did notice some stats and will take another look at them.
-
- The topic ‘Why are tags stripped out on one site, but not another?’ is closed to new replies.