Would you folks advise to place it in the header or footer.my experience i put in the footer. Does it matter?thxD

force
—
2013-09-07T23:49:10Z —
#2

Since the javascript file for google analytics is hosted on a different domain other than your own, the download will be asynchronous, thus won't much affect page load times. It's safe to put in the head.

WordPress.com stats has merged into Jetpack. Please use Jetpack instead of this plugin.......WordPress.com stats has merged into Jetpack and all future upgrades to WordPress.com Stats will only be available in Jetpack. Jetpack connects your blog to the WordPress.com cloud, enabling awesome features. Get Jetpack now!

There are many plugins and services that provide statistics, but data can be overwhelming. WordPress.com Stats makes the most popular metrics easy to understand through a clear and attractive interface.

And just because WordPress is closely tied to Automattic and shows both Akismet and Jetpack in the AdminCP doesn't really make them "core", though I imagine they're well integrated, or at least would hope so.

felgall
—
2013-09-12T22:05:35Z —
#10

Why not be consistent and place it at the very bottom of the HTML where you place ALL JavaScript. If someone stays on your page for such a short time that the HTML doesn't fully download then they probably are not worth including in the count.

Copy and place the code snippetOnce you find the code snippet, copy and paste it into your web page, just before the closing </head> tag*. If your website uses templates to generate pages, enter it just before the closing </head> tag in the file that contains the <head> section......*One of the main advantages of the asynchronous snippet is that you can position it at the top of the HTML document. This increases the likelihood that the tracking beacon will be sent before the user leaves the page. It is customary to place JavaScript code in the <head> section, and we recommend placing the snippet at the bottom of the <head> section for best performance.

I guess it depends on what you consider "best performance" to be.

felgall
—
2013-09-13T02:11:20Z —
#12

Mittineague said:

Good point. Even though Google says

Google is wrong. with their statement about where JavaScript goes - unless they are still looking primarily at Netscape browser users.

It is customary to place JavaScript code immediately before the </body> tag when targetting browsers other than Netscape 4 and earlier. That eliminates any need to test for whether the documenthas loaded or not.

Of course it makes no difference to me where people place their Google Analytics code as I have that script blocked so that it never loads regardless of where people put it. So there page will load just as fast no matter where they put that call.

pdxSherpa
—
2013-09-13T13:45:00Z —
#13

ok...well, placed in the header. seems to be working fine and causing no issues.Thank you all. And Mittineague for the jetpack info i'll keep it mind & perhpas try both on the next site so i can compare.D

adrian49
—
2013-09-26T17:42:26Z —
#14

I add it to the specific pages I want to track (normally just the squeeze pages).

samartyhsharma
—
2013-09-30T10:51:44Z —
#15

I prefer it in the footer but i am using allinone seo pack plugin it gives an option for placing the google analytics code