Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Mint auto.php, 2.17 upgrade and Google javascript

fork
Minted
Posted on May 01, '09 at 12:45 pm

Several years ago, in response to a discussion here, Shaun suggested adding our Google Analytics javascript to the Mint auto.php file so that, like Mint, we wouldn’t have to install the GA javascript on every page.

It has worked like a charm. Our Google and Mint stats, though not exactly the same, are close enough to act like a “backup” system for each other.

When I recently upgraded to Mint 2.17 on April 23 I forgot to replace the auto.php with my modified version and for the past week I lost all my GA stats. When I went to manually reinsert the Google code today (instead of replacing the auto.php with my old modified file) I discovered two things:

  1. The Mint 2.17 auto.php file appears slightly different than the old one I had been using (not sure how old it is).

  2. Google has an updated javascript they want us to use. The Google change was first offered years ago but because everything was working ok, we ignored the Google update.

I’m trying to determine if indeed, the auto.php file changed slightly in one of the 2.x updates. I installed the old Google javascript into the 2.17 auto.php file and Mint works. I’ll need another day to see if Google is tracking correctly.

I’m also wondering if I can insert the new Google code into the same place — the new code is much longer. Though I’m not a programmer, it seems to me that I should be able to remove the line breaks in the script and place it like before (Shaun originally said the Google javascript must be all on one line).

The old Google script, with line breaks removed by me, looks like this:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-000000-1";urchinTracker();</script>

The new script, with line breaks removed by me, looks like this:

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script> <script type="text/javascript"> try {var pageTracker = _gat._getTracker("UA-000000-1"); pageTracker._trackPageview();} catch(err) {}</script>

Shaun Inman
Mint/Pepper Developer
Posted on May 04, '09 at 02:33 pm

auto.php hasn’t changed since Mint 1.27 according to the change log. That Google changed their code shouldn’t have any impact on the way Mint or any of its files work.

Talkdoc
Minted
Posted on Oct 17, '09 at 01:37 am

How exactly do you add the GA code? I assume it goes between $mint = ’ < script src= ” / mint /? js” type=”text/javascript” > and < / script> ‘; but I’m only guessing. Or does it go at the very end of the file after the final ?>.

I don’t quite know how I feel about the program itself yet, but I have to say as someone who’s been an educator, psychologist, and statistician for over 30 years that the level of support and quality of information on these forums are, at best, ambiguously terse to the point of being useless—unless, maybe, you just happen to have a background in PHP programming.

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue