Support

Joomla Analytics and Live Chat

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

⚠️ Please note, we have now deprecated the Joomla plugin for automating the GoSquared installation. You can however, use the instructions below to install GoSquared manually into your Joomla site.


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.