Importing template now showing JavaScript Detected

Hi there,
I've been using the same template now for about a year and a half without any issues and then on importing it just now it started giving me a Javascript Detected warning.

I can't see anything in the html that would be considered javascript, and odd that it just started giving me that warning now.

Could someone from CM take a look and let me know what might be triggering this? The file that I'm importing can be found here

Thanks in advance.

Stig Stig, 3 years ago

Hi kmeronuk,

It looks like the javascript may be added to your file after you've uploaded it. If you view the source code of your file, you'll find lots of CloudFlare and Google Analytics related code:

<script type="text/javascript">
//<![CDATA[
window.__CF=window.__CF||{};window.__CF.AJS={"ga_key":{"ua":"UA-3456345-1","ga_bs":"2"}};
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) { var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",mirage:{responsive:0,lazy:0},oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/abv=1870252173/"},atok:"3e6a866f1dfdf38ef7faec22acfe5845",zone:"revisionrenovations.com",rocket:"a",apps:{"ga_key":{"ua":"UA-3456345-1","ga_bs":"2"}}}];document.write('<script type="text/javascript" src="//ajax.cloudflare.com/cdn-cgi/nexp/abv=4114775854/cloudflare.min.js"><'+'\/script>')}}catch(e){};
//]]>
</script>
<style>td{font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#232222;}a{text-decoration:none;color:#7197b5;}a:hover,a:active{text-decoration:underline;}p{padding:0;margin:0 0 8px 0;}h2{border-bottom:1px solid #e0e0e0;padding:0 0 5px;margin:0 0 8px;color:#19598b;font-size:15px;font-weight:bold;}h3{margin:0 0 8px;color:#19598b;font-size:13px;font-weight:bold;}h4{border-bottom:1px solid #e0e0e0;padding:0 0 5px;margin:0 0 8px;color:#19598b;font-size:15px;font-weight:bold;}div.spacer{clear:both;height:10px;}ul li{list-style-type:square;}td.content{line-height:19px;}</style>
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3456345-1']);
_gaq.push(['_trackPageview']);

(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);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l=document.getElementsByTagName("a"),t=document.createElement("textarea");for(i=0;l.length-i;i++){try{a=l[i].getAttribute("href");if(a&&"www.cloudflare.com/email-protection"==a.substr(7 ,35)){s='';j=43;r=parseInt(a.substr(j,2),16);for(j+=2;a.length-j&&a.substr(j,1)!='X';j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}j+=1;s+=a.substr(j,a.length-j);t.innerHTML=s.replace(/</g,"&lt;").replace(/>/g,"&gt;");l[i].setAttribute("href","mailto:"+t.value);}}catch(e){}}}catch(e){}})();
/* ]]> */
</script>

If you can try a cleanup, and ensure that extra code isn't being injected on your server, I think the file should import fine.


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
kmeronuk, 3 years ago

Ah yes, CloudFlare. Makes sense now.

Thanks for the fresh set of eyes on that.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098