Add Google Analytics

Nathan Paton edited this page Feb 10, 2016 · 3 revisions

You can use Google Analytics to collect helpful information on how members and visitors use and interact on your site.

As the name suggests, Google Analytics requires a Google account to setup and use. You can learn more and create an account here: http://www.google.com/analytics/

Look for the "Sign In" link in the header of the site, and click on it:

Screen Shot 2016-02-10 at 1.41.56 PM.png

Select "Google Analytics" from the sign in options:

Screen Shot 2016-02-10 at 1.43.25 PM.png

You'll be asked to login with your Google account, or to create one if you don't all ready have one. After logging in, you'll be brought to a new page to "Start analyzing your site's traffic in 3 steps". Click the large "Sign up" button on the right:

Screen Shot 2016-02-10 at 1.48.02 PM.png

You should now be on the New Account page, with a number of fields and options to setup and configure your account:

Screen Shot 2016-02-10 at 1.51.08 PM.png

Have no fear, as we're covering all the options. Under "What would you like to track?", select "Website" if it's not all ready selected.

Under "Setting up your account":

  • Account Name: Enter your name or site name. Example: Bob Loblaw

Under "Setting up your property":

  • Website Name: Enter your site name. Example: My Community
  • Website URL: Enter the URL for your site. Example: http://www.mydomain.com/
  • Industry Category: Select one of the categories that most describes what your site is about. Example: Online Communities
  • Reporting Time Zone: Select your country and local time zone.

Under "Data Sharing Settings":

These options are entirely up to you and have no effet on how Google Analytics works on Dolphin. These options only affect how the data is shared with Google itself for support and statistics information.

Once everything is filled in and selected, scroll down further and click the blue "Get Tracking ID" button:

Screen Shot 2016-02-10 at 2.04.49 PM.png

You'll be asked to accept the Google Analytics Terms of Service Agreeemnt for your country. Once accepted, you'll be redirected to the tracking code setup page for the site:

Screen Shot 2016-02-10 at 2.09.26 PM.png

We only need the "Website tracking" code. The other implementation options can be ignored, unless you need a deeper integration.

Installation of the Website tracking code differs between versions. Older versions of Dolphin will require it to be manually added to the header template, while newer versions can easilly add this code from the Administration Panel.

For Dolphin 7.2 and below

You'll need to add the tracking code to the header template, _header.tpl to have it run on all pages of the site. The code should be added directly before the closing </head> tag. Edit /templates/base/_header.html and look for (around line 37):

	<bx_injection:injection_head />
</head>

Add the full tracking code directly below the <bx_injection:injection_head /> line:

	<bx_injection:injection_head />
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-73618257-1', 'auto');
      ga('send', 'pageview');

    </script>
</head>

Save the file and clear Dolphin's cache from the Administration Panel => Tools => Cache.

You may have more than one _header.html file from other installed templates, like in the included Evo template. Make sure these changes are made to all of them.

For Dolphin 7.3 and above

Things are much easier in Dolphin 7.3. Instead of editing files, simply head into the Administration Panel => Settings => Basic Settings and look for the "Injections" block:

Screen Shot 2016-02-10 at 5.54.20 PM.png

In the <HEAD> Injection section, enter the full tracking code in the field and click the blue "Save" button. That's it - Dolphin will take care of the rest and embed the code in the header. No files to edit, no cache to clear.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.