Check our Summer Specials! Get a Free Account or SEO Bundle with 80% off. View Offers

Integrating Google Analytics

How to integrate Google Analytics with your phpBB 3 Board

Google Analytics is a powerful tool of monitoring the traffic on your website. It is mostly used by the administrators of your board and in this tutorial we are going to show you how to integrate this feature with your Board in few easy steps.

 

To integrate Google Analytics with your phpBB3, you need to:

Step 1 Obtain the Analytics code

First you will need to have an active Google Analytics account. You should be able to sign up for such at the official Google Analytics homepage

 

Once you are logged into your Google Analytics account you will need to obtain the tracking info provided by the feature. It is located under Admin>Tracking Info>Tracking Code for the website you have added to the service.

 

analytics-admin

 

Usually the code is provided under the “This is your tracking code..” sentence on the accessed pacge and you should be able to easily copy it.

 

Step 2 Integrate the Analytics code

Now that you have your tracking code it is time to integrate the code with your phpBB 3 platform. Unfortunately the platform does not provide a universal way of doing such integration and you will need to add the code manually to one of the files of your board.

The file where that code should be implemented is located under:
 

/installation_directory/styles/style-name/template/

 

The “installation_directory” is the actual directory where your board is installed at and the “style-name” is the actual name of the style you are currently using as default. Note that if you change your default style in future you will need to reapply the code for the new style as well.

 

The most convenient way of editing the code of that file is by using the integrated in your cPanel Code Editor. The feature is located under the File manager service of your cPanel. So basically you will need to navigate to the folder where the template of your currently used style is located using the File Manager service and locate the file “overall_header.html”.

 

file-manager

 

In the newly opened window you should be able to find the following line of code:
 

<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">

 

Paste BELLOW that line of code your Google Analytics tracking info code you have obtained in Step 1 and save the file.

Now you will need to allow few days for Google Analytics to properly collect the access information so you can be presented with the same in your Google Analytics account.

That is all you will need in order to integrate your phpBB 3 Board with the Google Analytics service.