Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone know a method to insert the Google Analytics tracking JavaScript object into an external application-driven HTML generator which automatically exports results to a web server via FTP?

A few restrictions. We CANNOT edit the template of this program :(. We also can't be constantly editing the the HTML files as they are continuously being uploaded as results come in and there are multiple HTML files depending on the class and event.

We are trying to track the number of visitors to the results system.

Background server info - Apache w/ PHP 5. This site is also distributed via a cloud-delivery model using MaxCDN.

I've also thought about adding .html as an executable PHP file and adding the automatic includes. But of course GA requires the tracker to be right before the tag.... :|

share|improve this question
1  
There isn't enough information to answer this question. You are asking it as if there was a standard approach, but you are using a bespoke system. Have the ftp destination not be the final one, then use a script to inject the javascript before moving them to the right folder. –  Paul Jun 25 '13 at 1:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.