Joomla GoSquared Installation

This guide takes you through the steps to add the GoSquared code to your Joomla site. Adding the code will enable you to use:

  • Now – real time analytics dashboard
  • Trends – historical analytics dashboard
  • Live Chat – on site messaging for your visitors
  • People CRM – user level profile tracking


Installation Instructions

This guide assumes you've already signed up for a GoSquared account.

  1. Log into your Joomla Control Panel.

  2. Select Extensions > Templates > Templates from the dropdown in the top menu bar.

    joomla control panel

  3. From within the Editor tab, select the index.php file from the list on the left hand side. This page contains content that will get used across the whole site, so it's the easiest place to add your GoSquared code.

  4. Now that you know where to add the code, next you'll need to copy and paste your GoSquared Analytics code into the index.php file, just before the closing tag </head> tag. This is enough to start using the Now, Trends and Live Chat.

  5. To create and update profiles in People CRM you'll need to add some more code. Scroll up to the top of the index.php file to find your list of definitions. You need to ensure you have a $user object defined. If the template you're using doesn't already do this for you, you'll need to add this code:

    $user = JFactory::getUser();

    to the definition list as shown in the example below:

    joomla definitions list

  6. Now that we have access to the $user object, we can use the identify method to pass back the user's details to GoSquared. In order to populate the identify method with their details, you’ll need to store the values in variables that can then be passed into the identify method. Through Joomla you have access to the all of these Object Member Variables and Parameters. So you’re code will look something like the below:

       
       <script>

           //store the user details in variables 

           var userEmail = <?php echo json_encode($user->email ); ?>;  
           var userName = <?php echo json_encode($user->name ); ?>; 
           var userUsername = <?php echo json_encode($user->username ); ?>; 
           
           //then pass the variables into the identify method

           _gs('identify', {  
             email: userEmail,  
             name: userName, 
             username: userUsername, 
           });

       </script>
       

    You need to add this code underneath the main GoSquared Analytics code that you've already added, again before the closing </head> tag.

    joomla identify code

  7. Now, next time a user logs in, their id, email address, name and username will be used to created a profile in GoSquared. Any actions they take during their session will attributed to this profile and you'll know who you're talking to when they send you a live chat message.


Joomla Plugin for GoSquared (deprecated)

You have the option to either install the GoSquared extension for Joomla with the automated installer or manually. Both are detailed below following by notes on setup.

Downloading and installing the GoSquared extension for Joomla using the automated installer:

  1. Download the GoSquared extension for Joomla from http://extensions.joomla.org/extensions/site-management/site-analytics/14315. Do not decompress/unzip the .zip archive.
  2. Navigate to your site's Joomla administration panel, in the navigation options select extensions > install/uninstall.
  3. Click the browse button and choose the gosquared-joomla-universal.zip file from your downloads folder.
  4. Click the upload file & install button.

Downloading and installing the GoSquared extension for Joomla manually:

  1. Download the GoSquared extension for Joomla from http://extensions.joomla.org/extensions/site-management/site-analytics/14315. Do not decompress/unzip the .zip archive.
  2. Transfer the gosquared-joomla-universal file via FTP/SFTP to your Joomla install directory (administrator/components/com_installer/extensions).
  3. Navigate to your site's Joomla administration panel, in the navigation options select Extensions > Install/Uninstall.
  4. Select install from directory indicating the correct folder name. This folder name should be an absolute path from the root of the filesystem.
  5. Click install.

Setting up the GoSquared extension for Joomla:

  1. Navigate to the Joomla plug-in manager by visiting extensions > plug-in manager.
  2. In the filter box search for GoSquared then click GoSquared plugin. On the right, under basic options, paste your GoSquared site account code which can be found at http://home.gosquared.com/developer. It will start with GSN.
  3. Click save & close.
Did you find this article helpful?