To collect the majority of user behavior events to BigQuery, OWOX BI, using either the customTask, customHTML, or analytics.js method, duplicates all the data Google Analytics collects from the website and sends it to the dedicated OWOX BI access point.

For collecting offline events or the events that happen after the user’s session on the website, Google Analytics offers using Measurement Protocol. The protocol can send any kind of user behavior data directly to Google Analytics using an HTTP request.

If you send certain events to Google Analytics via Measurement Protocol, you need to duplicate them to the OWOX BI access point as well. The access point is https://google-analytics.bi.owox.com/collect?tid=UA-XXXXX-X, where UA-XXXXX-X — is your Google Analytics tracking ID.

Without duplicating the request, the event data won’t get to BigQuery, which will result in data discrepancy with Google Analytics.

Sending requests

Sending requests to our access point is no different from sending them to Google Analytics: you send data as a POST or a GET request. See how the requests look like in Google documentation.

For a POST request, you need to specify a payload data identical to the one you send to Google Analytics.

Here’s an example of how it should look like:

v=1&tid=UA-12345-1&cid=555&t=pageview&dp=%2Fhome

NoteWhen sending a POST request to the OWOX BI access point, make sure you have the GET parameter tid specified — it’s the tracking ID of your Google Analytics property from which OWOX BI sends data to BigQuery.

For a GET request, specify the set of parameters in the request body.

We recommend using POST requests for sending data to our access point.

NoteData sent to the access point https://google-analytics.bi.owox.com/collect?tid=UA-XXXXX-X will appear in Google BigQuery only.
To send the data to Google Analytics, you still need to send a request to https://www.google-analytics.com/collect.

Using the queueTime (&qt) parameter and updating data

When sending data via Measurement Protocol, there can be cases when the transaction happens after the user session time on the website is expired. For example, online payment processing by a bank can take up to several days, and the transaction event will be sent only after that.

To avoid creating a separate session for such events, specify the &qt (queueTime) parameter in your request. This is a time period in milliseconds between the moment the hit happened and the moment it was sent.

When using the &qt parameter, the time when the hit received (the time field) is calculated considering the time difference specified in the &qt parameter.

When you send a non-zero &qt parameter:

  • Hits will always get to the hit data table (streaming) in BigQuery irrespective of the parameter’s value.
  • Session data collection based on the OWOX BI algorithm features the maximum &qt parameter’s value as 30 days. The hits will get to the relevant session in the session data tables (owoxbi_sessions) within 30 days* after the event happened.
  • For session data collection based on Google Analytics algorithm, the hits will be assigned to the corresponding sessions within 48 hours* considering the clientId and timestamp values sent in the custom dimension (&cd).

*After the end of the day when the events happened in the Google Analytics property timezone.

NoteIf the &qt parameter is more than 4 hours, the hit won’t get to Google Analytics. This will lead to data discrepancy: OWOX BI will get more data than Google Analytics.
Set the &qt parameter's value to more than 4 hours only if you need the events sent via Measurement Protocol to get to the sessions during which they've happened.

Limitations

  • The request must contain the clientId (&cid) or the userId (&uid) parameter. Without sending at least one of these parameters, a hit will be processed neither in OWOX BI nor in Google Analytics.
  • In OWOX BI Pipeline, the maximum hit payload size is 16 KB. If exceeded this limit, hits won't be processed and sent to BigQuery.
  • In Google Analytics hit payload must be no longer than 8 KB.
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.