Jump to content
xisto Community
webleaks

How To Install Google Analytics In Wordpress

Recommended Posts

Google Analytics Introduction

Google Analytics is a free web analytics service by Google that generates detailed statistics about the visitors to a website.

 

Sign up with Google Analytics

 

 

1.First you need to create an account with Google Analytics.(visit Google Analytics Signup Page.)

 

2.You can use your existing gmail account to sign up with analytics.If you don't have a gmail account, you need to create one.

 

3.After Signing in with your gmail account you will be prompted to fill the required information about your website.After this you will need to provide your contact information.

 

4.Then you will be provided with a code to paste on your pages.Copy it in a safe location.

 

 

Install Google Analytics in WordPress

 

There are 3 ways to install Google analytics in WordPress.

 

 

1. Direct Pasting

 

Copy the code that you got while signing up with google analytics ,and paste it in your theme’s footer.php right above the </body> tag.

 

2. Using Functions.php

 

 

Add the foll. code to your theme's functions.php file

 

<?php

add_action('wp_footer', 'add_googleanalytics');

function add_googleanalytics() { ?>

// Paste the Google Analytics code here

<?php } ?>

 

 

3. Plugins Method

 

There are many good WordPress plugins that can do the work for you.Such for google analytics in wordpress plugin repository and you will get a list of available plugins.

 

Share this post


Link to post
Share on other sites

It seems to be a very easy task to include google analytics in your page, but this tutorial could be a litle more specific, or maybe I am missing something, but whenever you add an action and create a function for this code, you need to set in the template where to place it? or it will place itself automatically, magically just before the body tag?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.