How to embed a Google Analytics Tracking Code into Vetstoria and create a goal

A clinic or marketing 3rd party, can request a google analytics tracking code to be embedded into Vetstoria to allow detailed tracking within their own Google Analytics account.

Note: This can only be enabled by Vetstoria Admins

This also does not currently support cross-domain

The following must be done by a Vetstoria Engineer on behalf of the clinic

  1. Settings > Admin. Settings > Tracking
  2. Enable Google Analytics
  3. Enter the Tracking ID of the clinic website (GA Property; for example, UA-156556188-1)
  4. Add this code to the 'Google Analytics script' box

    1. (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','https://www.google-analytics.com/analytics.js','ga');
  5. Save Changes

The Google Analytics account should now be receiving data from Vetstoria.

 

Vetstoria Data in Google Analytics

You should be seeing data in Reports > Realtime > Overview as users are on the page. 

The page data will look similar to:

In all cases:

  • You'll see a .vetstoria.com domain URL in your data.
  • The hash will be unique for the clinic.
  • The suffix will determine the stage of booking they are in

 

If the user is on your webpage using the widget, the URL will show:

This is because the code is operating in the widget, not on the website.

Note that there is a prefix in there of 'theme=widget'

Funnel/Goal Steps

Then the following suffix URL is the steps, and should be as follows:

/?step=1 : #branch
/?step=2 : #appointment-type
/?step=3 : #slots
/?step=5 : #pet-owner-details
/?step=9 : #completed

 

/?Step=8 : Cancel/Reschedule Screen
 - user can go back to step 1 if they edit
 - if they cancel, they will land on /?step=9 again.

Goal Setup

An example of a simple funnel using the above steps and the goal destination.

Traffic Source Referrals

  • Source will be the website the widget is hosted on
  • Referral Path will be the page the widget is embedded on.