fbpx
Call us +1-231-421-7160

Adding Google Analytics (Joomla 3)

Google Analytics offers a number of tools that can help you track the traffic that visits your site. By creating a Google Analytics account and linking it to your Joomla site, you can see how many people visit your site on an hourly, daily, weekly or monthly basis. You can see how many unique visitors come to your site, their page views, how long they spend on at your site and much, much more. This article gives an overview of how to register your site at Google Analytics and how to link your Google Analytics account to your Joomla site.

An Overview of Google Analytics

Submitting a Support Ticket

Inserting the Tracking Code Using FTP

An Overview of Google Analytics

Google Analytics is very easy to use, and once it's linked to your site, it will start to work automatically. First, go to the Google Analytics site to setup an account. There, find your Tracking ID (also called the Web Property ID) and a piece of Tracking Code. The Tracking ID is a UA-123456-7 format. Keep the Tracking ID and the Tracking Code handy. Depending on which type of template you're using, you'll need one or the other. We suggest that you simply keep that site open until your work is done. The screenshot below offers a sample of the Tracking ID and Tracking Code given once a Google Analytics account is opened.

googleanalytics1

Submit a Support Ticket

Once you've created the account, you can simply share the Tracker ID and the Tracking Code with CloudAccess.net and we'll take care of the rest. Learn how to submit a support ticket. You can also contact your template developer to see if there is an easy option for inserting the Tracker ID or Tracking Code into your template. We've included some rough instructions below for adding the Tracker Code using FTP.

Back to Top

Inserting the Tracking Code using FTP

Although the template you're currently using may not feature an easily accessible place to enter your Tracker ID supplied by Google Analytics, you can still manually insert the Tracking Code using file transfer protocol (FTP). If you do not know how to access your site using FTP, please learn how to access your site using FTP. Follow the steps below to insert the Tracker ID in a non-Gantry template.

Next, after establishing an Analytics account, copy the Tracking Code given by Google Analytics.

GAt1

Go back to your FTP directory. and find and open the httpdocs file for your site.

GAt2

Once inside the httpdocs file, find and open the templates file.

GAt3

Once inside the templates file, find and open the template that is set as your default template for the site in your Joomla application. Please note that if you're using multiple templates for multiple pages, you'll have to apply for multiple Google Analytics accounts and repeat this process for each template that you're using. If you're using one template for the entire site, you'll only have to do this procedure once.

GAt4

Once inside the default template file, locate the index.php file. Why the index file? By placing the code in the index file, it will render for all pages in your site as long as that's the template you're using for each page. As mentioned above, if you are featuring different templates, you'll have to repeat this process for every template. Open the index.php file by right-clicking on it and selecting the "View/Edit" option.

GAt5

Your index.php file will open in a new window. We highly recommend that you backup this file on your disk before proceeding. Learn how to download a backup of a file using FTP. If you make a mistake, you'll have to have CloudAccess.net run a restore for your site. But, if you make a backup prior to inserting this code, you can just paste the file right back into your site using FTP. 

In the index.php window, scroll all the way to the bottom. Locate the final </body> tag. Before the final </body> tag, insert the code that you received when you established your Google Analytics account.

GAt6

Don't forget to save your work. If you added the Google Analytics code into a backup file that you made (you didn't make the changes live using FTP), you can upload the new file and overwrite the existing file in FTP. Learn how to overwrite a file using FTP.

Back to Top

Do you have suggestions for improving this article?  

We take a great deal of pride in our knowledgebase and making sure that our content is complete, accurate and useable. If you have a suggestion for improving anything in this content, please let us know by filling out this form. Be sure to include the link to the article that you'd like to see improved. Thank you!