June 6th, 2008

Adding Analytics Code To Journals


I am interested in adding some analytics (Google/Mint) code into journals. I've figured out how to add it into the main site (very simple), but getting into journals is proving to be a bit more difficult. I am not sure if I have to edit each s1 and s2 theme or if there's some place where I can place it once and be done with it.

Any help is much appreciated!


Update: Figured it out! For S2 stuff, edit the file /cgi-bin/LJ/S2.pm. I stuck it in around line 1957, seems to work fine :) As for S1, that took some poking around, but it seems /cgi-bin/ljviews.pl does the trick, I inserted this code:

$lastn_page{'head'} .= qq{YOUR SCRIPT CODE \n};

around line 1106 and it seems to be working as well, hopefully this helps someone!