Skip to content

How to upload data to Google Analytics

You can upload data to Google Analytics to get more insights. You can create wide range of data sets.

What you can send?

Basically everything that can connected in any way to your data in Google Analytics.

Cost data

It is obvious, you can connect Google Ads woth Google Analytics, therefore you can see the cost data of your Google Ads campaigns at Google Analytics reports. But what if you would like to add the costs of other ad channels you use, both online and offline?

Luckily, Google Analytics gives you tools, so you can upload the ad data from all of the used ad channels.

Here the primay keys are the UTM parameters you use for every ad. Every ad contains UTM parameters, it appears in Google Analytics as the source of the visit. On the other hand, you have the cost data (and also impression) for every ad at the ad system.

One of the easiest way to send ad campaign data to Google Analytics is the help of Owox Bi pipeline. Just choose the ad service (eg. Facebook ads) and the destination (Google Analytics).

how to upload data to Google Analytics
Facebook ad data to Google Analytics

Ecommerce product data

If you have a really big site you should use it. Why? Because Google Analytics has a limit, the payload can’t be bigger than 8 192 bytes. It means, the payload can’t be longer than 8 192 characters. If the sent data is more than 8 192 bytes, Google Analytics just drop it, so it never arrives at Google Analytics.

payload_data â€“ The BODY of the post request. The body must include exactly 1 URI encoded payload and must be no longer than 8192 bytes.

Google Developer Docs – https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#using-post

So, if you reach this limit (note: it is a lot of data for one hit, so it is not so easy to reach, but you can 🙂), you have two options:

  • Split the payload to smaller chunks and send the data in 2,3 or more pieces
  • Reduce the data you send and upload later the additional info

Focus now only the second one, because the first one is not a data upload issue.

If your site has realy long item, category, variant names you can reach easily the 8 192 character limit. If you have enhanced ecommerce and you would like to send all of these data within eg. the product impressions and the category page contains more than 50 products. It can easily overload it.

The best way to avoid the lost of data is you only use product id and send the additional info later with data upload to Google Analytics.

The product id is the primary key. So, you just have to create a table, with the product ID and the additional info (name, categories, variant, etc.) and upload it.

You don’t have to upload it every day, just every product modification. If your list changes reguralry you should use some automation. If the list changes a script uploads the new version of your data.

Refund

Enhanced ecommerce has the option to send refund data. If your client modifies the purchase (add or remove items, delete the transaction), you can send thins info back to Google Analytics.

Here the transaction ID is the primary key. If you have to change only some items, you can add the product sku, price and the refunded quantity. If you would like to change the whole transaction, you can add the revenue.

I suggest, to use all the fields. If some kind of refund occurs, you can send it with another script, so you don’t have to send it by yourself.

And more

You are able to upload more types of data. I’ve just highligted I use reguralry, but here the list you can upload, too:

  • User Data—create segments and remarketing lists that incorporate imported user metadata, such as a loyalty rating or lifetime customer value.
  • Campaign Data—expand and reuse your existing non-Google campaign codes by importing ad campaign-related dimensions, such as source.
  • Geographical Data—create custom geographical regions, allowing you to report on and analyze Analytics data in ways that are better aligned with your business’ organization.
  • Content Data—group content using imported content metadata, such as author, date published, and article category.
  • Product Data—gain better merchandising insights by importing product metadata, such as size, color, style, or other product-related dimensions.
  • Custom Data—provides support for importing custom data sets.

How can you send offline data to Google Analytics

There are two options to upload data to Google Analytics.

  1. Upload by yourself – use it when the data set is small and no need regular uploads
  2. Automatic upload – if you have larger data sets and daily uploads you should use it

Whether you choose an automatic upload or not first you have to create a data set. Here it is the official step-by-step instructions about the data upload.

After you created a data set, Google Analytics provides you a sample file It is important, to use exactly the same format. If you change anything the upload fails. So be careful, but if you use the same format it will be ok.

Upload by yourself

If you don’t need automatic uploads, you can do it by yourself. If I upload data by myself to Google Analytics, I usually create a simple Google Sheet, based on the csv Google Analytics generated after the data set creation. Just fill this Google Sheet, export it back to csv and upload it to Google Analytics.

Automatic upload

If you have larger data sets and regular uploads I highly recommend you to use this method. First of all, you need developers who can create the connection with Google Analytics and prepare for data upload.

You can read the developer documentation here: https://developers.google.com/analytics/devguides/config/mgmt/v3/data-import

The key is the data set id, this is the “name” of your data set

Published inAnalytics

Comments are closed.