Insert google analytics tracker into application-automated static HTML page

1

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

knotseh

Posted 2013-06-25T00:57:48.277

Reputation: 111

1There 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 – 2013-06-25T01:35:31.823

No answers