Skip to main content

Track widget drop off on Google analytics

You can track events with Google analytics.

F
Written by Fabio Fois
Updated over 3 months ago

Track widget drop-off by triggering events at each step of the booking journey and sending virtual page views to Google analytics. This setup helps you understand where users abandon the process.

⚠️ Warning: Your custom success page won't work if you are using an Iframe, either embed your widget with the standard code or use an external widget URL.

Track your widget drop off

Below you can find guidance on all steps to track your widget drop off.

Create your GTM container

Follow the steps below to create your GTM container:

  1. Login to your tag manager.

  2. Click the three dots on the top right.

  3. Click Create Container.

  4. Add your container name.

  5. Click Web.

  6. Click Create.

  7. Copy the code on the top right corner, it should look like GTM-xxxxxx.

Add the Google ID to ResDiary

Follow the steps below to add your Google container ID to your diary:

  1. Click Settings, then Widget Tracking.

  2. Select Google tag manager.

  3. Paste the ID on the text field.

  4. Click Update.

Create your custom variables

Follow the steps below to create your custom variables on Google tag manager:

  1. From your tag manager, click the new container.

  2. Click Variables, then New.

  3. Click Variable contifuration.

  4. Select a data layer variable form the variable types.

  5. Add exactly namevirtualPageURL as variable name, it is case sensitive.

  6. Select layer version two.

  7. Repeat the steps above to add a second variable.

  8. Ensure this variable is named virtualPageTitle, it is case sensitive.

  9. Select layer version two.

Create your custom trigger

Follow the steps below to create your custom trigger on Google tag manager:

  1. From your tag manager, click Triggers.

  2. Click New, then Trigger configuration.

  3. Select a custom event from the list.

  4. Add VirtualPageview as an event name, it is case sensitive.

  5. Select trigger fires on some custom events.

  6. Then add event contains VirtualPageview.

Create your new tag

Follow the steps below to create your new tag on Google tag manager:

  1. From your tag manager, click Tags.

  2. Click New, then Tag configuration.

  3. Select universal analytics from the list.

  4. Select pageview from the track type.

  5. Select new variable from the Google analytics settings.

  6. Complete the following fields:

    • Enter your tracking ID.

    • Set cookies to auto.

  7. Click More Settings, then Fields to Set.

  8. Add the following fields:

    • Set page as name and {{virtualPageURL}} as value.

    • Set title as name and {{virtualPageTitle}} as value.

  9. Click Triggering.

  10. Select the VirtualPageview trigger.


Test your widget drop off

Follow the steps below to test and preview your widget drop offs:

  1. From your tag manager, click Preview.

  2. Load the page that contains your widget on another page.

  3. Create a booking in the widget.

  4. You should see an event fired on Tag manager for each page.

Below is a list of events being tracked:

virtualPageURL

virtualPageTitle

/resdiary-widget/venueSelection

Select a venue.

/resdiary-widget/initial

Select covers, date and time.

/resdiary-widget/promotion

Select a promotion.

/resdiary-widget/confirmation

Confirm booking request details.

/resdiary-widget/contact

Enter contact details.

/resdiary-widget/success

Booking was successful.

/resdiary-widget/payment

Enter credit card details.

/resdiary-widget/error

Error details.


Set your Google analytics goal

Below you can find the steps to setup your conversion goal on Google analytics:

Set your conversion goal with custom success page

Follow the steps below to set your Google analytics goal with custom success page:

  1. Go to your Google analytics property.

  2. Click the Admin panel.

  3. Click Goals.

  4. Click New goal.

  5. Select Custom, then click Continue.

  6. Give it a name and select the destination as type.

  7. From goal details, set destination to regular expression.

  8. Add resdiary\-widget\/success on the text field.

  9. Enable Funnel.

  10. Add the following details:

Name

Screen or page

Select covers, date and time.

resdiary\-widget\/initial

Select promotion, optional.

resdiary\-widget\/promotion

Enter contact details.

resdiary\-widget\/contact

Confirm booking request details.

resdiary\-widget\/confirmation

Enter credit card details, optional.

resdiary\-widget\/payment

Set your conversion goal without custom success page

Follow the steps below to set your Google analytics goal with no custom success page:

  1. Go to your Google analytics property.

  2. Click the Admin panel.

  3. Click Goals.

  4. Click New goal.

  5. Select Custom, then click Continue.

  6. Give it a name and select the destination as type.

  7. From goal details, set destination to regular expression.

  8. Add booking-successful on the text field.

  9. Enable Funnel.

  10. Add the following details:

Name

Screen or page

Select covers, date and time.

resdiary\-widget\/initial

Select promotion, optional.

resdiary\-widget\/promotion

Enter contact details.

resdiary\-widget\/contact

Confirm booking request details.

resdiary\-widget\/confirmation

Enter credit card details, optional.

resdiary\-widget\/payment

You can test your conversion by following the steps below:

  1. From your analytics dashboard click Conversions.

  2. Click Goals, then Funnel Visualisation.

  3. Select your goal.

Did this answer your question?