21474 Posts in 5781 Topics by 2620 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 946 Views |
-
Google Analytics Problem

3 June 2011 at 5:44pm Last edited: 3 June 2011 5:45pm
I am trying to install the tracking script on a Silverstripe site so I can generate visitor stats for the site.
It's easy enough to do, Google produces a script that you are supposed to copy and paste just before the closing </head> tag on the page (i.e. on the Page.ss file)
NOW... the problem is that I can never get the script to sit in the right place.
I'm using SS 2.4.5 and it is ALWAYS and automatically putting the include tags for the CSS files LAST.
So I can never place Google's script next to the </head> tag and Google Analytics tells me that the tracking stuff is not installed. So I can't get Analytics happening.
Very odd, this has never happened to me before and I've installed those tracking scripts in heaps of SS sites.
What do I do now? Anybody? Please?
-
Re: Google Analytics Problem

4 June 2011 at 1:22am Last edited: 4 June 2011 1:27am
Hi _Vince.
You want to use the asynchronous version, right?
( described here )I used this some time ago before i switched to another tracking solution, but i placed it before my </body> tag instead without any problems.
But anyway, maybe you could try this in your Page_Controller:
public function init() {
parent::init();
Requirements::insertHeadTags(" ... insert your tracking code here ...");
}Cheers
Christian(Edit: man i suck big time at formatting code in this forum! I wonder how to keep tabs...
)
| 946 Views | ||
|
Page:
1
|
Go to Top |


