Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Browse other questions tagged .