Built by owners, for owners.

Is there a better way to track widgets in Google Analytics?

Replies: 5 - Pages: 1 - Last Reply: Jan 26, 2021 10:50 PM by: Mill Creek Cabin
Mill Creek Cabin
Registered: 1/4/21
Is there a better way to track widgets in Google Analytics?

I'm having a hard time understanding my web traffic info and guest interaction with my website. The widget URLs are hard to digest and make it hard to track anything with the default settings. Does anyone have any suggestions for setting up Google Analytics and Widgets?

Is there a way to change the way widgets appear or add a note to the URL?
/widgets/a3eb5a9907d5466fa9b746b3eb83452978?seq=ml"

Chris Hynes
Registered: 10/19/12
Re: Is there a better way to track widgets in Google Analytics?

You don't need to manually work with the widget URL's. Instead:

1) Set up your OwnerRez account for Google Analytics: https://www.ownerreservations.com/support/articles/analytics-tracking

2) Customize your site's GA code to track visitors cross domain (from your site through the widgets to the resulting booking): https://www.ownerreservations.com/support/articles/cross-domain-widget-analytics

Mill Creek Cabin
Registered: 1/4/21
Re: Is there a better way to track widgets in Google Analytics?

2.1) I assume you're putting "window.OwnerRez = { skipLoadDefaultWidgets: true };" within the script tag? It doesn't quite read that way.

2.2) Where are you putting:

ga(function(tracker) {
window.OwnerRez.loadDefaultWidgets(tracker);
});

In the header after GA code? beginning of widget?

Thanks for your help, Chris!

Chris Hynes
Registered: 10/19/12
Re: Is there a better way to track widgets in Google Analytics?

Some answers:

1) The first bit of JS can go anywhere you already a script tag (or you can add a new one).

2) The second bit of JS goes after both GA and the OwnerRez widget code, so it can reference them both and link them together.

I added an example page to the bottom of the article: https://www.ownerreservations.com/support/articles/cross-domain-widget-analytics -- does that help show how everything should lay out?

Mill Creek Cabin
Registered: 1/4/21
Re: Is there a better way to track widgets in Google Analytics?

That helps! This is my first time using JS.

One thing to note here - I set up cross-domain tracking using google tag manager. Not sure if this is the best way to go about it yet.

For reference, I'm using Wix (I would recommend it so far) so in the tracking tools menu, there is a field to enter custom scripts within the body tag.

On pages that host widgets, I entered the script from 1) just after <body> and placed script 2) at the end just before the </body> tag.

Pages: 1