Recently I worked on Google Analytics for Pension Reforms and thought to share my experiences. 

I also worked on the conversion and migration of Pension Reforms old website which was built in a C# .Net platform to Salesforce Communities using the Lightning Component Framework.

This blog will provide a brief introduction to Salesforce Communities, the Lightning Component Framework and steps to set up and enable Google Analytics. Before starting our journey, let me take this opportunity to thank Mark and Sam for believing in me that I could handle and complete this task. I am grateful for their consistent guidance and support. I would also like to thank Michael Littlewood, the principal editor of Pension Reforms for the thank you that he shared and in believing in the magic and power of this amazing platform – Salesforce! 

A Thank You Note From Michael Littlewood at Pension Reforms

I am the principal editor of, a website that, since 2006, has offered free, sortable access to academic reports from around the world on pensions, saving, retirement and public policy issues associated with all those.

We all know what Salesforce is for so when the good folk at Coroma Consulting told me that PensionReforms could be run on Salesforce, I must admit to some scepticism.  But it works.  You really wouldn’t know it’s a Salesforce product and I guess that’s a compliment.

So, if you want fast, accurate access to more than 700 academic reports that are sortable by topic, author, country, year of publication and institution; and that offers opinionated summaries of those reports, might disturb some of your fondest thoughts on retirement income policies.  And no, Australia does not have the ‘best’ pension arrangements in the world, despite what you may have read elsewhere.

Thanks, Coroma Consulting and special thanks to the people responsible.  Also,  particular thanks for fitting PensionReforms into your pro bono work slot.

Michael Littlewood

Auckland, New Zealand

May 2018

What is Salesforce Communities?

Communities are a great way to share information and collaborate with people outside your company who are key to your business processes, such as customers or partners. Using easy point-and-click branding tools with Lightning templates or Visualforce to create branded collaboration spaces, Communities live inside your org and can be easily accessed from the App Launcher in Lightning Experience.

What is Lightning Component Framework?

The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices. The framework supports partitioned multi-tier component development that bridges the client and server. It uses JavaScript on the client side and Apex on the server side. The benefits include an out-of-the-box set of components, event-driven architecture, and a framework optimized for performance.

What is the use of Google Analytics

Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic. Google launched the service in November 2005 after acquiring Urchin. Google Analytics is now the most widely used web analytics service on the Internet.

How does Google Analytics work?

To enable Google Analytics in Salesforce, you must set-up your Google Analytics Tracking ID in Community Builder, this enables access to your Salesforce data.  To complete this follow the steps below:

  1. First, let Google Analytics access your data to collect page views. Go to Settings > Advanced in Community Builder and enter your Google Analytics Tracking ID.
  2. Then select Let Google Analytics access your Salesforce data for deeper insights into search activity to allow Google Analytics to track user types, user IDs, and customer search activity within your community.

When you publish your community to enable the service, your community’s search data streams directly to Google Analytics and appears in your Google Analytics reports.

Once Google Analytics is enabled for your community, follow the below steps to set up Google Analytics:

  1. Login in to your Google Analytics Account by entering username and password. If you don’t have an account you can create one from this page.
  1. Create custom dimensions in your Google Analytics account that capture user type and Salesforce object information. From your Google Analytics account, go to Admin > Property > Custom Definitions > Custom Dimensions. Click +New Custom Dimension.

The first dimension you create in your Google Analytics account is automatically sorted as Index 1.

    a. For Index 1, enter the Name: User Type and select Hit for the scope.

    b. For Index 2, enter the Name: Salesforce Object and select Hit for the scope.

  1. Create a User-ID view. With the User-ID view, you can analyze how specific segments of traffic with an assigned ID engage with your content. To create a User-ID view, go to Admin > Property > Tracking Info > User-ID and follow the instructions.
  2. For the User-ID view, enter the Name: User Explorer.

In the User Explorer view on the Home Page, user usage and page views metrics for Salesforce communities is now visible.

Refer to Salesforce Documentation for more details on Google Analytics for Salesforce Communities:  


Leave a Reply

Your email address will not be published. Required fields are marked *