12
How to Add Google Analytics to WordPress? As one of the most widely used website statistics services, Google Analytics is offered by Google that generates detailed statistics about a website’s traffic and traffic sources and measures conversions and sales. The regular service is free to use from April 2005, and premium version is available for a fee. Besides introducing what Google Analytics is, Magee.com wrote this WordPress tutorial to teach you how to add Google Analytics to WordPress.

How to add google analytics to wordpress sites

Embed Size (px)

Citation preview

Page 1: How to add google analytics to wordpress sites

How to Add Google Analytics to WordPress?

As one of the most widely used website statistics services, Google Analytics is offered by Google that generates detailed statistics about a website’s traffic and traffic sources and measures conversions and sales. The regular service is free to use from April 2005, and premium version is available for a fee.

Besides introducing what Google Analytics is, Magee.com wrote this WordPress tutorial to teach you how to add Google Analytics to WordPress.

Preparation

Step 1. Register Google Analytics

Visit Google Analytics, create a new Google account or sign in your existing account. Complete the registration according to the instructions.

Page 2: How to add google analytics to wordpress sites

Step 2. Get tracking ID & code

After registration, connect Google Analytics with the website that you want to track. Filling the form with required information, such as website’s name, website url, choose the industry category and select a reporting time zone. Finished by click on the “Get Tracking ID” button.

Then move to your Google Analytics Profile, navigate to “Tracking Info” and you will see that the system provides you with a Tracking

Page 3: How to add google analytics to wordpress sites

ID and some tracking code. Copy these tracking codes for further use.

Add Google Analytics to WordPress

There are two commonly used methods of adding Google Analytics to WordPress:

1. Adding Tracking code manually

You can add tracking codes to three different places in WordPress, including Text widget, header.php, and footer.php.

If you choose to add tracking codes to Text widget, Google can only track the data of the widget’s page. But if you amend header.php and footer.php files, Google Analytics can cover the entire website.

Page 4: How to add google analytics to wordpress sites

1) Add Text widget

Go to Dashboard -> Appearance -> Widgets. Find the Text widget in the leftAvailable Widgets area, and drag it to the place you like to display in the right area. (If choose Displayed Everywhere, the widget will be displayed in every page of your website. Different themes support different widget-available areas.)

Then type in a title, paste the tracking ID you have got from Google Analytics and save the settings.

2) Amend header.php file

Go to Dashboard -> Appearance -> Editor, find out header.php from the right Template list and click to open it.

Page 5: How to add google analytics to wordpress sites

Search for <head></head> in the left edit box, and paste the tracking ID between <head> and </head>. Finally click on the “Update File” button.

3) Amend footer.php file

Go to Dashboard -> Appearance -> Editor, find out footer.php from the right Template list and click to open it.

Search for <footer></footer> in the left edit box, and paste the tracking ID between <footer> and </footer>. If you cannot such codes, paste the tracking ID before the ending mark </body>. Finally click on the “Update File” button.

Page 6: How to add google analytics to wordpress sites

2. Applying Analytics plugins

If you think that adding codes is too complicated, you can use a plugin, which named “Google Analytics for WordPress”.

Page 7: How to add google analytics to wordpress sites

1) Go to Dashboard -> Plugins ->Add New, search for “Google Analytics for WordPress”, install and activate it.

2) Go to Dashboard -> Settings -> Google Analytics, navigate to Analytics Profile, click on the button to authenticate with Google or enter your UA code manually.

Page 8: How to add google analytics to wordpress sites

3) Choose the displaying place of the tracking code, amend more specific setting if you need, and finally save the settings.

Page 9: How to add google analytics to wordpress sites

All of the above mentioned methods take you only minutes to add Google Analytics to WordPress. If you are running a business website through WordPress, Google Analytics is a necessity. With the all-rounded statistics offered by Google Analytics, you won’t miss anything about your website. Have a try now, and welcome to share with us your experience.