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

Mill Creek Cabin
Jan 25, 2021 9:47 PM
Joined Jan, 2021 4 posts

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
Jan 26, 2021 12:08 AM
OR Team Member Joined Oct, 2012 1401 posts

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

1) Set up your OwnerRez account for Google Analytics: https://www.ownerrez.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.ownerrez.com/support/articles/cross-domain-widget-analytics

Mill Creek Cabin
Jan 26, 2021 9:14 PM
Joined Jan, 2021 4 posts

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
Jan 26, 2021 10:13 PM
OR Team Member Joined Oct, 2012 1401 posts

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.ownerrez.com/support/articles/cross-domain-widget-analytics -- does that help show how everything should lay out?

Mill Creek Cabin
Jan 26, 2021 10:50 PM
Joined Jan, 2021 4 posts

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.