Chris Berg
asked 10 years ago

Support,

When I try and paste my tracking code in the Theme Options for DW Focus and save it, it ends up taking out the "scripts" inside the code. For example, this is the code I want:

<!-- AFS ANALYTICS Asynchronous Tracking Code  V6 -->
<!-- For: http://kchanews.com -->
<div id='addfreestats'></div>
<script type="text/javascript"><!--
var AFS_Account="00932998";
var AFS_Tracker="auto";
var AFS_Server="www9";
var AFS_Page="DetectName";
var AFS_Url="DetectUrl";
var AFS_Protocol="http:";
var speed = document.createElement('script');
if (document.location.protocol == "https:") AFS_Protocol="https:";
speed.type = 'text/javascript';
speed.async = true;
speed.src =AFS_Protocol+'//'+AFS_Server+'.afsanalytics.com/cgi-bin/afstracka.cgi?usr='+AFS_Account;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(speed, s);
//--></script>
<noscript>
<a href="http://new.afsanalytics.com/?usr=00932998" rel='nofollow' >
<img src="https://www9.afsanalytics.com/cgi-bin/connect.cgi?usr=00932998Pauto" border='0' alt="AddFreeStats"></a>
</noscript>
<!-- END- AFSANALYTICS.com AUTOCODE V6 -->

And when I click Save, this is what it changes it to:

<!-- AFS ANALYTICS Asynchronous Tracking Code  V6 -->
<!-- For: http://MY WEBSITE HERE.com -->
<div id='addfreestats'></div>
<!--
var AFS_Account="MY STAT ACCOUNT NUMBER";
var AFS_Tracker="auto";
var AFS_Server="www9";
var AFS_Page="DetectName";
var AFS_Url="DetectUrl";
var AFS_Protocol="http:";
var speed = document.createElement('script');
if (document.location.protocol == "https:") AFS_Protocol="https:";
speed.type = 'text/javascript';
speed.async = true;
speed.src =AFS_Protocol+'//'+AFS_Server+'.afsanalytics.com/cgi-bin/afstracka.cgi?usr='+AFS_Account;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(speed, s);
//-->

<a href="http://new.afsanalytics.com/?usr=MY STAT ACCOUNT NUMBER" rel='nofollow'>
<img src="https://www9.afsanalytics.com/cgi-bin/connect.cgi?usr=MY STAT ACCOUNT NUMBERPauto" border='0' alt="AddFreeStats"></a>

<!-- END- AFSANALYTICS.com AUTOCODE V6 -->
1 Answers
DominicStaff
answered 10 years ago

Hi,
I have checked on our demo and I think it’s bug come from our theme, I sent and notified our technical team about this problem. We will check and fix it.
You can add the following code in your theme’s functions.php

add_action('wp_footer', 'add_googleanalytics');
function add_googleanalytics() { ?>
<!-- AFS ANALYTICS Asynchronous Tracking Code  V6 -->
<!-- For: http://kchanews.com -->
<div id='addfreestats'></div>
<script type="text/javascript">
var AFS_Account="00932998";
var AFS_Tracker="auto";
var AFS_Server="www9";
var AFS_Page="DetectName";
var AFS_Url="DetectUrl";
var AFS_Protocol="http:";
var speed = document.createElement('script');
if (document.location.protocol == "https:") AFS_Protocol="https:";
speed.type = 'text/javascript';
speed.async = true;
speed.src =AFS_Protocol+'//'+AFS_Server+'.afsanalytics.com/cgi-bin/afstracka.cgi?usr='+AFS_Account;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(speed, s);
</script>
<noscript>
<a href="http://new.afsanalytics.com/?usr=00932998" rel='nofollow' >
<img src="https://www9.afsanalytics.com/cgi-bin/connect.cgi?usr=00932998Pauto" border='0' alt="AddFreeStats"></a>
</noscript>
<!-- END- AFSANALYTICS.com AUTOCODE V6 -->
<?php } ?>

You can now click on the Reporting tab to see your site’s analytics overview. It takes Google up to 12 – 24 hours to start providing you with the awesome site stats that you need.
Hope this helps !

ckubs
replied 10 years ago

Hello. Since the topic is about a bug I want to notice another regarding theme options, and I guess it’s not necesary to open another topic. Some elements added in the CSS box are transformed to their html codes or missing after I click save. For example, "\"( need it when adding Fontawesome icons via CSS) gets deleted after save.

Those: < > " … are transformed to their html codes &lt; &lt; &quot; after save.

dominic Staff
replied 10 years ago

Thank you for interesting in our product and your feedback. We appreciate it. I sent and notified our technical team about this problem. We will check and fix it. Any your suggestion will make our product become better and better.
Regards,

cbergy21
replied 10 years ago

Thanks Dominic! Right now, I’m using a plugin to do the job for tracking. I will edit the functions.php and will begin using the theme again for that. I appreciate the help and glad I could also help you out as well.

dominic Staff
replied 10 years ago

Thank you very much, my friend 🙂

Powered by DW Question & Answer Pro