Web Analytics

Third Party Data in Google Analytics

weather data in google analytics

It is obvious that digital analytics is a means to obtain data-driven answers to digital questions. This is because every page load, impression, click and video view is tracked and analyzed. But what about the relationship between digital platforms and the environment outside the world of digital? For example, what effect does the weather have on your customers? Or the exchange rate? Or the result of last night’s football match?

Unfortunately, this data is not readily available within standard digital analytics tools. This is why we have compiled this blog post, in which we examine what data can be added to GA, how this data can be used to answer business questions and how these answers can be used to improve your business.

What Data can you add into Google Analytics?

The first step when adding third party data is taking a good look at your business and considering which environmental factors are most likely to impact it. There is no point adding sports results to a small online shop offering bespoke lighting, as these are very unlikely to be correlated to the business.

The second step that we need to address is the source of the data. The key to our implementation is that the data needs to be available via an API. An API is a means of communicating with another service that has the data we are looking for.

We are not going to go into the technicalities here, but there are a lot of APIs out there offering the sort of data we might be interested in. Some of these are free, some of them are free up until a certain number of calls, while others are exclusively paid for services. Before you start looking to add data, it is important to find the API that you will be using.

How do you get this data into Google Analytics?

To start adding this data to GA, we need to make use of Google Tag Manager. If you are not going to be responsible for this step, you can skip to the next section. Just bear in mind that you will need someone with an understanding of GTM, JavaScript and APIs to do the implementing.

Most of the work happens within a custom HTML tag that is deployed via GTM. Within this tag, you can access the third party data of your choice and then send the results to Google Analytics.

For those doing the technical implementation here are three tips:

  • When querying the API, push the results to a dataLayer variable so that they are easily accessible in your GA tag.
  • Send the data to GA in the form of a non-interaction event, as this allows you to track page views as per normal without having to wait for the API. We also suggest adding the data from the API as session-level custom dimensions that get sent along with the GA event.
  • Finally, we suggest setting a cookie that mimics the GA session cookie when making your API call. This cookie can then be used to ensure that the script responsible for making API calls only fires once per session.

All of this is possible within GTM and should not require any changes to your website.

What questions can you answer with this data?

After you have accumulated enough data in your Google Analytics account, you are then able to investigate the correlation between this third party data and traditional digital metrics such as transactions and page views.

To display how this could be used, we have included an example from the fictional online clothing store “E-Clothing”:

Below is a report that combines third party weather data and the product category “socks”. This allows us to answer the question, “in what weather are people most likely to buy socks?”.

Weather Data in Google Analytics - Cold

As we can see from this report, the conversion rate (measured as the percentage of detail views that result in a purchase) is highest when it is raining. This is also when the most socks are sold. The second highest conversion rate is when there is light rain and the third highest when it is overcast. This suggests that people are more inclined to buy socks when the weather is poor.

Below is another report that shows the product category “swimwear” alongside the same weather dimension from the above report.

Weather Data in Google Analytics - Hot

Here we can see behavior that contrasts the “socks” behavior. Unlike socks, swimwear sees the highest conversion rates when the weather is clear.

Finally, we are going to look at an example where third party data in the form of sporting results is combined with product data. In this example we are using football results for all matches involving Arsenal, more specifically the goal difference, and comparing this to product sales of Arsenal merchandise.

This allows us to answer the question of “are merchandise sales related to team results?”.

Football Data in Google Analytics

The result that stands out the most in the above table is the first row, whereby Arsenal won by three goals. Views of Arsenal merchandise directly after this game saw by far the highest conversion rate, and accounted for a large portion of total purchases.

Given more data that follows the same pattern, we can easily conclude that the conversion rate for team merchandise is indeed correlated to that team’s performance.

What can you do with these answers?

Adapt your advertising strategy

One of the most logical applications of this data is the optimization of advertising campaigns.

Given the performance of the “socks” category and the “swimwear” category in the above example, we could easily adjust our advertising for these categories based on the weather.

In rainy or poor weather, we could increase the bids for our “socks” campaign while simultaneously decreasing the bids for our “swimwear” campaigns. We could also re-allocate budget so that the budget that is normally allocated to swimwear gets moved to socks.

Then, when the weather is clear, we could reverse the process and allocate all of the socks budget to swimwear and re-adjust the bids.

Similarly, given the correlation between sporting results and team merchandise, we could allocate more of our advertising budget towards team merchandise for teams that have recently recorded convincing wins.

These optimizations can either be done manually, but in most cases should be done programmatically (keep an eye out for an upcoming blog post on adjusting AdWords bids based on the weather). Either way, including these new factors in our optimizations can help us in achieving a higher ROI for our Advertising spend.

Adjust your website content

In addition to PPC advertising, this data could also be used to customize the content on your website. By making use of the same APIs from which the data is collected, we are able to change which products are displayed on the home page of E-Clothing, based on the current weather conditions.

Next Steps

All that is left is for you and your team to brainstorm which external factors are most likely to impact your online performance, find an API that will allow you to access this data and start tracking!

If you have any questions, please send me an email.

Don't Miss Our Web Analytics Articles

Check Out Our Web Analytics Services