View Full Version : Hiding asrep tracking code
JimmyChen
06-25-2007, 05:33 AM
Jeremy,
Just a quick question.
I realise asrep tracking code is reveal within the html.
This will expose where we run the asrep code from.
How can we hide it from the public?
Techie
06-25-2007, 08:22 AM
Well there is really no way to totally hide it from the browser side. Some people think if you obfuscate the page code (make it like 02kklakn2jklj29snk929... when view the source) or disabling Javascript will hide it. I am not much of a fan of these methods and they can be defeated.
Since this whole plan is on the up and up I don't see any problem search engine wise. However I totally understand trying to prevent people from researching your websites using this method.
So enters the choices (you may use all of them too):
1) You want a central domain for Asrep for sure, however you can make the domain look like its a general counter site and nothing else.
Okay these are more complex:
2) I would say the best way to keep people from at least looking up all your sites via the search engines is to use external Javascript files.
So on your website, where you want Asrep to appear, put this:
<SCRIPT language="JavaScript" SRC="/counter.js"></SCRIPT>Now in a separate file called counter.js (that is because if you look code above is calling/loading counter.js)
Place the Asrep code and save it. Now upload your counter.js file and page(s).
You can go overboard now and create a new filename for each website.
Ex:
cnt1.js
c20.js
02ls.js
902.js
etcSo it would like like:
<SCRIPT language="JavaScript" SRC="/c20.js"></SCRIPT>
This way the SE's will skip the external code and you aren't leaving any footprint.
3) You may register multiple domains and use the CNAME technology to point them back to the Asrep domain.
Please note these techniques don't hide the code from someone viewing the code itself but they do provide a level of privacy to avoid linking all your domains together if that is what you are concerned about.
JimmyChen
06-25-2007, 08:43 AM
Jeremy a.k.a The Tech King!
Thanks for the tips!
1) I already have a central domain for asrep which all my website are pointing to.
2) I have been trying out the whole day how to get an external javascript to run php.
Conclusion (from various forums): Javascript is client-based, PHP is server-based thus they can't mix.
Any pointers on this will be much appreciated!
Paranoid somehow...
Techie
06-25-2007, 12:20 PM
That isn't true. PHP and javascript can work together. Of course it depends on what you are trying to do but you can use an external javascript file to make a remote call to a PHP script.
For example:
<SCRIPT language="JavaScript" SRC="/counter.js"></SCRIPT>
In the external js script call a remote PHP script:
document.write("<img src='http://www.somewebsite.tld/somefile.php' width='1' height='1'>");That would call a PHP script using Javascript.
JimmyChen
06-27-2007, 07:16 AM
Jeremy,
Excellent! It works like a charm. WooHOo~
Techie
06-27-2007, 09:09 AM
Good deal. In addition the img method, which is the most widely used, there is also calling the PHP script in an iframe. The iframe code would go into the external .js file.
JimmyChen
06-27-2007, 08:08 PM
Jeremy,
In the asRep code, there's two parts.
One is with the script to record.php.
Second is within the <noscript> tag as such:
<noscript>
<img width="1" height="1" border="0"
src="record.php?rep=v&transport=img" />
</noscript>
I guess it's for browser with no javascript function. I can't possible put it in an external .js since it's <noscript> correct?
Anyway, I'll experiment with iFrame as well...
Thanks Jeremy! Appreciate it lots.
Techie
06-28-2007, 09:00 AM
You may put the noscript code into the external javascript file if you wish. Simply use the print command I used.
Remember Adsense won't even display if a visitor has Javascript off, so don't worry that this is an external js file.
External js file code:
document.write('<img width="1" height="1" border="0" src="record.php?rep=v&transport=img" />');
Sydney
06-29-2007, 06:15 AM
I didn't understand anything Jeremy was talking about! That's why HE handles all our tech stuff. Lucky me. :D
On the non-tech side ... don't worry about 'hiding' tracking code. The SEs expect that smart marketers do testing & tracking and don't penalize for it. If you're really concerned about it, buy a cheap domain name (.info are usually $2.99) and run AsRep or other tracking from that site. As I've mentioned, WBSResearch.com is our "catch-all" site for testing & tracking. The word "research" sounds appropriate for testing & tracking, right?
JimmyChen
07-04-2007, 06:16 AM
Jeremy,
I just found out that site is accessing my external js because there's a connection to my central domain for asrep. But asrep is not tracking it!
When I switch back to the normal asrep codes within the page itself, it works again.
I think I'll switch back to what's working while testing on this.
Techie
07-04-2007, 07:54 AM
Do you have page with the external javascript file linking to it? This type of technology does work.
JimmyChen
07-05-2007, 12:16 AM
Do you have page with the external javascript file linking to it? This type of technology does work.
Yes indeed. It's linking because I've tested using a simple alert ("hello") and it shows the alert box from my page.
Jeremy, if you don't mind sharing, how do you use your WBSResearch.com as a "catch-all" site? I've check the sample Tier C site that Sydney first introduces to us, http://www.asthmaanswersonline.com/
but I can't seem to find any tracking codes that you are using..
Techie
07-05-2007, 08:41 AM
Well as a test site the Asthma one we aren't running AsRep on it. That site is more for showing what can be done, although we do make money with it. Afterall people like to see examples. :)
Email the code (-----) you are putting into your external javascript file (for AsRep) and the code you are using to insert into the pages. I will see what I can do. It is possible and works when setup the way it likes.
Techie
07-05-2007, 11:27 PM
For the record, in case others read this, the problem was the proper URL wasn't being used which wasn't tripping the script. So, yes, as I have said its possible. :)
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.