![]() ![]() |
How do I add Google Analytics to other skins? |
Mar 11 2007, 06:55 AM
Post
#1
|
|
|
Administrator ![]() ![]() ![]() Group: Root Admin Posts: 5,130 Joined: 25-January 07 Member No.: 1 |
By default, like most features in CommunitySEO, Google Analytics works under the Spider skin but no other skin sets you have installed.
To add Google Analytics to your other skins, login to your Admin CP, visit the Look & Feel tab, click the button next to your skin, and click "Edit HTML Templates". Click on All Global HTML, and then click on global_board_header. Add the following to the very beginning of this skin template bit CODE <if="$this->ipsclass->vars['seo_google_urchin']"> <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"> var pageTracker = _gat._getTracker("{$this->ipsclass->vars['seo_google_urchin']}"); pageTracker._initData(); pageTracker._trackPageview(); </script> </if> Click on "Save Template Bit" and repeat for each skin you have installed. |
|
|
|
Jun 21 2007, 10:54 AM
Post
#2
|
|
![]() Advanced Member ![]() ![]() ![]() Group: Customers Posts: 77 Joined: 30-May 07 Member No.: 216 |
Is this the adsense business? I have adsense on my site, but just the normal code I was provided with by Google. If I change it to this, how different is it?
|
|
|
|
Jun 23 2007, 03:26 AM
Post
#3
|
|
|
Administrator ![]() ![]() ![]() Group: Root Admin Posts: 5,130 Joined: 25-January 07 Member No.: 1 |
No, this is analytics. It's a javascript-based metrics program from Google basically.
google.com/analytics |
|
|
|
Oct 2 2007, 09:09 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 44 Joined: 11-September 07 Member No.: 464 |
|
|
|
|
Oct 2 2007, 08:11 PM
Post
#5
|
|
|
Administrator ![]() ![]() ![]() Group: Root Admin Posts: 5,130 Joined: 25-January 07 Member No.: 1 |
It's still the same - we didn't want to add instructions for dozens and dozens of skin edits to the main installation, many of which users may not want or need. As a result, we've separated out all the skin edits to FAQ entries in this forum.
If you want the Google analytics feature on the skins your users use, you will need to add it using the above instructions. |
|
|
|
Jan 16 2008, 10:56 PM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 309 Joined: 9-November 07 From: Middle of the Desert state Member No.: 574 |
I believe Google has updated the Analytics code. This is the code they gave me and said it needs to be placed right before the </body> tag.
The XXXXXXX is your account ID. CODE <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"> var pageTracker = _gat._getTracker("UA-XXXXXXX-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> |
|
|
|
Mar 21 2008, 11:24 AM
Post
#7
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 143 Joined: 10-September 07 From: CA Member No.: 459 |
Twisted, yes you're correct. That is the newer format.
|
|
|
|
Apr 14 2008, 07:19 PM
Post
#8
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 209 Joined: 23-March 07 From: Birmingham, AL Member No.: 57 |
Can this skin edit be updated for the new google analytics code?
|
|
|
|
Apr 19 2008, 02:51 AM
Post
#9
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 264 Joined: 29-August 07 Member No.: 424 |
|
|
|
|
Apr 20 2008, 11:07 PM
Post
#10
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 309 Joined: 9-November 07 From: Middle of the Desert state Member No.: 574 |
Just edit the spider skin and any skins you added the code to after install with the new code. Make sure to use your account number as I don't think the settings in ACP will edit new code yet.
|
|
|
|
Apr 25 2008, 10:31 AM
Post
#11
|
|
|
Newbie ![]() Group: Customers Posts: 4 Joined: 10-October 07 Member No.: 518 |
Just so it is posted here;
Replace old script in header template CODE <if="$this->ipsclass->vars['seo_google_urchin']"> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "{$this->ipsclass->vars['seo_google_urchin']}"; urchinTracker(); </script> </if> With the new Tracker CODE <if="$this->ipsclass->vars['seo_google_urchin']"> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "<A href="https://ssl">https://ssl</A>." : "<A href="http://www">http://www</A>."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("{$this->ipsclass->vars['seo_google_urchin']}"); pageTracker._initData(); pageTracker._trackPageview(); </script> </if> Acct will still update via AC |
|
|
|
Apr 26 2008, 11:21 PM
Post
#12
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 209 Joined: 23-March 07 From: Birmingham, AL Member No.: 57 |
<if="$this->ipsclass->vars['seo_google_urchin']">
<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"> var pageTracker = _gat._getTracker("{$this->ipsclass->vars['seo_google_urchin']}"); pageTracker._initData(); pageTracker._trackPageview(); </script> </if> This looks like it works. I'll know in a day if google is collecting data. |
|
|
|
May 17 2008, 11:44 AM
Post
#13
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 209 Joined: 23-March 07 From: Birmingham, AL Member No.: 57 |
<if="$this->ipsclass->vars['seo_google_urchin']"> <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"> var pageTracker = _gat._getTracker("{$this->ipsclass->vars['seo_google_urchin']}"); pageTracker._initData(); pageTracker._trackPageview(); </script> </if> This looks like it works. I'll know in a day if google is collecting data. Hmm, google analytics isnt working. Wonder if I am banned? |
|
|
|
May 31 2008, 11:26 PM
Post
#14
|
|
![]() Advanced Member ![]() ![]() ![]() Group: Customers Posts: 30 Joined: 26-December 07 From: India Member No.: 683 |
So can any one tell me which code is exactly is working now ??
|
|
|
|
Oct 19 2008, 07:08 PM
Post
#15
|
|
|
Administrator ![]() ![]() ![]() Group: Root Admin Posts: 5,130 Joined: 25-January 07 Member No.: 1 |
First post updated
|
|
|
|
Oct 24 2008, 12:23 PM
Post
#16
|
|
|
Advanced Member ![]() ![]() ![]() Group: Customers Posts: 264 Joined: 29-August 07 Member No.: 424 |
Thanks admin!
|
|
|
|
Nov 2 2008, 09:19 AM
Post
#17
|
|
|
Newbie ![]() Group: Members Posts: 2 Joined: 1-November 08 Member No.: 1,496 |
I didn't want to put it using the Static News/Announcements method because it was meant for something else and someday I may want to use that feature. Also method #1 put the code snippet at the top of the page before the post entries whereas Google's suggestion is to put it at the bottom of the page before the </body> tag. Method #2 was a good option but if I want to change my skin to refresh my site's look and feel I'd have to do the same thing on each skin that is loaded for my site. I ended up choosing method #3 because it placed the code a lot closer to where Google wants and if I want to change my sites skin I don't have to edit the skin's master page.
-------------------- You are making progress if each mistake is a new one.
aoc gold review |
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
22 | admin | 3,128 | 18th August 2008 - 04:37 AM Last post by: admin |
|||
![]() |
7 | admin | 2,938 | 30th December 2008 - 10:17 AM Last post by: Silent J |
|||
![]() |
4 | admin | 2,397 | 27th January 2008 - 06:15 AM Last post by: admin |
|||
![]() |
3 | admin | 2,896 | 9th February 2008 - 05:25 AM Last post by: admin |
|||
![]() |
0 | RSS Aggregator | 1,331 | 29th January 2007 - 01:50 PM Last post by: RSS Aggregator |
|||
Links to this thread
|
Lo-Fi Version | Time is now: 5th January 2009 - 08:54 PM |