Tuesday, May 21, 2013

How to Install Google Analytics Code in PHP



Get Google Analytics Code

1. Navigate to google.com/analytics/ and click the 'Access Analytics' button. Enter your email and password and click 'Sign in' to log in to your Google Analytics account.

2. Find the Website Profile for your site. Click the 'Edit' link under the 'Actions' column on the far right-hand part of the screen.

3. Click the 'Check Status' link above the 'Main Website Profile Information' box to reveal the tracking code.

4. Click in the white box under 'Paste this code on your site.' Press 'Ctrl' and 'a' to select all the text and press 'Ctrl' and 'c' to copy the text to the clipboard.

Insert Google Analytics Code

5. Open each PHP file into which you want to insert the Google Analytics code using an editor or the Notepad. Scroll down to the bottom of the file and locate the '

' tag.

6. Click immediately proceeding the '

' tag. Press 'Enter' to open a blank line. Click at the beginning of the blank line.

7. Press 'Ctrl' and 'v' to paste the Google Analytics code in the file. Save the file and repeat the process for any other PHP files in the website.

No comments:

Post a Comment