Sitecore Experience Analytics Google Chart

Why require your team to login to multiple systems just to review collected analytics?

This solution contains a SPEAK 2.0 component that allows for custom Google Analytic reports to be displayed within a dashboard page right in xAnalytics.

This is the exact source code as seen at the Sitecore Symposium 2016 talk ‘Experience the Singularity of Data’ and re-shown during a live webinar in October (get the full replay at https://www.paragon-inc.com/bringing_google_analytics_and_sitecore_together.)

You can download the source to play with along with Sitecore install packages from the GitHub repo https://github.com/gillissm/Paragon.Sitecore.ChartByGoogle.

What’s Included

  • TDS project for Sitecore artifacts
  • Two branches of code
    • MASTER – targets Sitecore 8.2 Initial Release, and is built using the new dependcy injection pattern
    • Sitecore_81 – targets Sitecore 8.1 update 3, and should work against any version that supports SPEAK UI 2.0
  • Sitecore package as found in _Documents folder
    • If you are running Sitecore 8.1 install the Sitecore package ‘Paragon.Sitecore.ChartByGoogle_8.1.zip’
    • If you are running Sitecore 8.2+ install the ‘Paragon Sitecore ChartByGoogle_82-1.zip’

GAInSitecore.png

How to Use

  1. Install the included Sitecore package or sync via TDS a. This only should be installed on a CM server!
  2. Login to Google Anayltics and create a service account, see https://developers.google.com/identity/protocols/OAuth2ServiceAccount
  3. Save the .JSON and .P12 files provided to the data folder on the CM server
  4. Update the following values in z.Paragon.GoogleAnalyticsChart.config a. JsonService with the file name of the .JSON b. P12Service with the file name of .P2 file c. AccountEmail wiht the email address supplied as part of the service account created
  5. The Google API assemblies have a dependicie on Newtonsoft.Json verision 7 so you must update your web.config with the following
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0" />
      </dependentAssembly>
  1. Open Sitecore Expierience Analytics and you should find a new report page named ‘Google Anayltics’
  2. Add the new control as needed to new pages.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s