THETECHNOSOLUTION

Server 2012, SCCM 2012, Windows, MDT 2013

  • Home
  • Server 2008
  • Server 2012
  • MDT
  • SCCM 2012 R2
  • Windows
  • Oracle
  • WordPress

Google analytics to wordpress without plugin

October 18, 2013 by Raj Kumar 13 Comments

Adding Google analytics to wordpress without plugin

There are many plugins to add Google analytics to wordpress, Google Analytics is very useful tool for any website or wordpress. There are lot’s of plugins available in wordpess to add Google analytics but when there is a simple way is available then why we use plugins, having lots of plugins in your wordpress is decrease  your blog performance I suggest only use wordpress plugins when there is no simple way is available for doing this you can maintain your blog performance. Follow steps given below to add Google analytics to wordpress without plugin.

  • Create Google analytics accounts if not created yet
  • Log in to Google analytics accounts
  • Click on the Admin page on the right side after login
  • Select a account from the dropdown list in the Account column
  • In property column click on tracking info
  • Click on the tracking code then copy the code
  • Login to your WordPress blog as admin
  • Click on Appearance then click editor
  • In editor you find header.php click on it
  • Paste your Google analytics code just before </head>
  • Save your file

 

That’s it now you can track your wordpress blog with Google analytics.

To loging or Singup in Google Analytics Click link given below for adding Google analytics to wordpress without plugin.

Google Analyitics

 

 

 

Filed Under: Wordpress Tagged With: Google Analytics

Comments

  1. BeverleyMauck5506@yahoomail.com'Read Webpage says

    December 17, 2013 at 2:30 am

    Hey there my buddy! I wish to express that this post is incredible, great created obtainable with approximately almost all major infos. I wish to find far more articles like this .

    Reply
    • Raj Kumar Singh says

      December 31, 2013 at 3:08 pm

      Thanks

      Reply
  2. marius@jits.no'Clorith says

    December 29, 2013 at 1:08 pm

    Although this is the way to add analytics without a plugin, it’s not advised to do so, as any theme update will overwrite your custom edits to the theme files. A plugin would not have your analytics lost just because the theme is updated, so no need remembering to re-add them manually, and is therefore the recommended approach.

    Reply
    • Raj Kumar Singh says

      December 31, 2013 at 3:13 pm

      Thanks, WordPress provide many plugins to do this, this is the process if you u want to do it manually

      Reply
  3. maiorano84@hotmail.com'Matt Maiorano says

    December 30, 2013 at 7:46 pm

    It can certainly be done this way, but it is FAR from ideal. WordPress provides a lot of tools in the way of enqueueing Javascript, and making sure that everything remains as compartmentalized as possible. The way this SHOULD be done might look a little more complicated, but it ensures that everything follows the standard order of operations, as well as taking any potential naming conflicts into consideration.

    Since this is done on the server-side, more advanced users can enqueue their Javascript files on an as-needed basis rather than unnecessarily loading external assets on pages that don’t require them.

    Add the Google Analytics code into its own Javascript file and place it on your server alongside the rest of your Javascript files (usually a directory in your theme called “scripts” or “js”). Then in functions.php, add the following:

    add_action( ‘wp_enqueue_scripts’, ‘my_theme_add_scripts’ );
    function my_theme_add_scripts(){
    wp_register_script(‘google-analytics’, get_stylesheet_directory_uri() . ‘/scripts/google_analytics.js’);
    wp_enqueue_script( ‘google-analytics’ );
    }

    This will ensure that your Javascript files are added appropriately. The same logic works for enqueueing stylesheets as well.

    Reply
    • Raj Kumar Singh says

      December 31, 2013 at 3:21 pm

      Thanks for providing this way to add analytics.

      Reply
  4. sben38@hotmail.com'Sarah says

    January 21, 2014 at 12:05 pm

    Thanks Matt Maiorano and Raj for your insights.
    Does using Matt’s method prevents me from adding any code before the closing tag in my theme’s php files? Or do I still need to add something on these files ?
    (My theme is also “Iconic One Theme”)

    Thanks in advance for your help.

    Reply
  5. engineersnamo1991@gmail.com'amit kumar says

    April 11, 2014 at 10:14 am

    thankful for giving wonderful knownledge about google analytics . you are doing good job kept up.

    Reply
    • Raj Kumar says

      April 11, 2014 at 10:15 am

      Thanks Amit keep visiting

      Reply
  6. kojoacquah7@gmail.com'Kojo says

    May 7, 2014 at 6:52 am

    Thank you for this. First search result and I got what I needed. You’re even using the same theme as I am

    Reply
    • Raj Kumar says

      May 7, 2014 at 7:32 am

      Thanks Kojo keep visiting

      Reply
  7. prashants07@live.in'prashant Sharma says

    October 4, 2014 at 9:28 am

    thanks Raj…really very helpful article.:)

    Reply
    • Raj Kumar says

      October 4, 2014 at 11:52 am

      Thanks Prashant Keep Visiting

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Facebook
  • Google+
  • RSS
  • Twitter

Recent Posts

Manage Remote Computer with Computer Management Tool

Deploy windows 7 using mdt 2013

How to Set Internet Explorer home page via GPO

Windows 10 God Mode Feature

Top 10 – Windows Server 2016 New Features

All About Genesis Framework and Theme

Copyright © 2022 · THE TECHNOSOLUTION · Built on the Genesis Framework