Event Collection
Learn how to collect events to your data cloud.
With GrowthLoop, you can use any events you collect from your website and mobile app that land in your Data Cloud
to create audienes and journeys. Whether you are using MetaRouter, Google Analytics, Heap, Amplitude, Segment, Rudderstack, Snowplow to ingest events, as long as they are loading to your Data Cloud, they can be used in GrowthLoop.
If your company does not currently collect event data from your mobile and web application into your Data Cloud
and you are looking for an easy to use solution, you can always use the Event Collection Service
.
In this article, you'll see how to implement the Event Collection Service
in your website. Once your event data is landing in your Data Cloud
you can configure your Event
tables as Datasets
in GrowthLoop to begin using them in Audiences and Journeys in a matter of minutes.
Event Collection Service to your Data Cloud
- To use our supported event collection (in partnership with MetaRouter), you'll need to:
-
- Create a cluster that writes to BigQuery.
- Add a snippet of code to the global header of your site.
- Implement any additional tracking for your use cases. Examples and docs can be found here.
- GrowthLoop can create the cluster on our end. Please contact your solutions architect so they can set up the cluster for you. This cluster will contain all the services you need to start sending events from your property to your integrations.
- While GrowthLoop creates the cluster, we'll set up BigQuery as a destination. Please provide your solutions architect with your credentials and project ID.
- Once you've created the cluster, it is time to add code to your site. Add the code snippet below to the global header of your site:
<script type='text/javascript'>
!(function() {
var analytics = (window.analytics = window.analytics || [])
if (!analytics.initialize) {
if (analytics.invoked) {
window.console && console.error && console.error('MetaRouter snippet included twice.')
} else {
analytics.invoked = !0
analytics.methods = [
'trackSubmit',
'trackClick',
'trackLink',
'trackForm',
'pageview',
'identify',
'reset',
'group',
'track',
'ready',
'alias',
'debug',
'page',
'once',
'off',
'on',
'addSourceMiddleware',
'addIntegrationMiddleware',
'setAnonymousId',
'addDestinationMiddleware',
]
analytics.factory = function(e) {
return function() {
var t = Array.prototype.slice.call(arguments)
t.unshift(e)
analytics.push(t)
return analytics
}
}
for (var e = 0; e < analytics.methods.length; e++) {
var key = analytics.methods[e]
analytics[key] = analytics.factory(key)
}
analytics.load = function(key, e) {
var t = document.createElement('script')
t.type = 'text/javascript'
t.async = !0
t.src = ("https:"===document.location.protocol?"https://":"http://")+"tbd.com/"+key+".js"
var n = document.getElementsByTagName('script')[0]
n.parentNode.insertBefore(t, n)
analytics._loadOptions = e
}
analytics.SNIPPET_VERSION = '4.13.1'
analytics.load("growthloop_marketing_site")
analytics.page()
}
}
})()
</script>
In the snippet you'll need to replace t.src = ("https\:"===document.location.protocol?"https\://":"http\://")+"tbd.com/"+key+".js"
with wherever the file is hosted. For example, if the file was at https://growthloop.com/files/growthloop_marketing_site.js then that line should be
t.src = "https://growthloop.com/files/growthloop_marketing_site.js
or t.src = ./files/growthloop_marketing_site.js
By default, we'll set up Page
Events, but a solutions architect can help you track more custom events like Add to Cart
, and Purchase Completed
if you'd like.
Every Analytics.js API call has a common structure. While some specific calls pass extra information, they will all pass the information detailed in this section. While our supported event collection can include all of these fields, not every destination will accept every field listed below.
Field | Type | Description |
---|---|---|
anonymousId | Object (optional) | A pseudo-unique substitute for User ID. This is for cases when you don't have an absolutely unique identifier. |
context | Object (optional) | Dictionary of extra information that provides useful context about a message that is not directly related to the API call |
integrations | String (optional) | Dictionary of destinations to either enable or disable |
messageId | String (implicit) | Automatically collected, this is a unique identifier for each message that lets you find an individual message across the API |
receivedAt | Date (implicit) | The timestamp of when a message is received by MetaRouter |
sentAt | Date (optional) | The timestamp of when a message is sent to MetaRouter |
type | String (implicit) | Type of message, according to the Event method |
userId | String (required) | Unique string that identifies a user in your database |
version | Number (implicit) | Version of the Tracking API that received the message, automatically set by MetaRouter |
Once you have everything set up, you should start seeing your events populate in BigQuery.
Updated 3 months ago
Once you have Events Streaming into BigQuery, you can start exporting audiences.