Title: Analytics tracking code doesn&#039;t work
Last modified: August 30, 2016

---

# Analytics tracking code doesn't work

 *  [vanchuck](https://wordpress.org/support/users/vanchuck/)
 * (@vanchuck)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/analytics-tracking-code-doesnt-work/)
 * In the source code, the analytics tracking code is tied to admin_head action,
   not wp_head action, so it shows up only in the admin side of things.
 * I would assume you’d want to ONLY track non-admin visits.
 * Also, there should be a note that in the Google Analytics tracking code, you 
   want to paste the entire <script>…</script> block provided by Google, not just
   the UA-XXXXXX-X code.
 * [https://wordpress.org/plugins/ws-google-webmaster-tools/](https://wordpress.org/plugins/ws-google-webmaster-tools/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [journeyman_73](https://wordpress.org/support/users/journeyman_73/)
 * (@journeyman_73)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/analytics-tracking-code-doesnt-work/#post-6711014)
 * i’ve had to change line 25 to
    add_action(‘wp_head’, array(&$this, ‘ws_add_js_scripts’),
   5); an now it works fine
 *  [Hoosierboy](https://wordpress.org/support/users/hoosierboy/)
 * (@hoosierboy)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/analytics-tracking-code-doesnt-work/#post-6711085)
 * journeyman_73 saves the day! That solution worked for me as well, and the GA 
   code snippet now shows up in my web pages.
 *  [GustavoAformarse](https://wordpress.org/support/users/gustavoaformarse/)
 * (@gustavoaformarse)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/analytics-tracking-code-doesnt-work/#post-6711093)
 * If you add this code:
    add_action(‘wp_head’, array(&$this, ‘ws_add_js_scripts’),
   5); What’s the matter when you update the theme?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Analytics tracking code doesn't work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ws-google-webmaster-tools_ffffff.
   svg)
 * [Verify Google Analytics & Webmaster Tools](https://wordpress.org/plugins/ws-google-webmaster-tools/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ws-google-webmaster-tools/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ws-google-webmaster-tools/)
 * [Active Topics](https://wordpress.org/support/plugin/ws-google-webmaster-tools/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ws-google-webmaster-tools/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ws-google-webmaster-tools/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [GustavoAformarse](https://wordpress.org/support/users/gustavoaformarse/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/analytics-tracking-code-doesnt-work/#post-6711093)
 * Status: not resolved