This article is a deep-dive companion to How to use Data Activation exports and shows you how to choose and run a historic event export.
With the Historic event export type, you can export all interaction data and fact data. Because this typically produces a large volume of information, we recommend specifying a query to fine-tune your filter.
Understand the file structure
The exported file follows this naming convention:
File name: fromdate-todate-uniqueID-trackingEventsStream.txt.gz
Example:
20210217-20210224-6970f9ac-459f-4592-9445-fc01751274c9-trackingEventsStream.txt.gz
Container:
.gz(a.txtfile inside the.gzfile).Structure: JSON line format (each line is a valid JSON message).
Example data:
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178134045,"eventId":"6a582cd0-76af-11eb-b445-876cdba6ec7e","transactionId":"10212","value":500,"products":["product1","product2"],"variables":{"variant":"1"},"interactionType":"conversion"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178144872,"eventId":"70cc3e80-76af-11eb-a51e-9bc5cda736fb","url":"https://demoshop64.relay42-demo.com/","source":"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36","interactionType":"sessionStart"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178166119,"eventId":"7d764770-76af-11eb-9e00-ed7479652290","type":"Customer","ttl":600000,"forceInsert":false,"variables":{"country":"test"},"operationType":"INSERT","interactionType":"externalFact"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178172829,"eventId":"817624d0-76af-11eb-91ec-a38b45b97fab","url":"https://demoshop64.relay42-demo.com/","source":"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36","interactionType":"pageView"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178187285,"eventId":"8a13f450-76af-11eb-9e00-ed7479652290","type":"productView","content":"","variables":{"productId":"8"},"interactionType":"engagement"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178197810,"eventId":"9059f120-76af-11eb-afba-b1ff9ddc9c50","partnerNumber":2,"partnerCookie":"dfbafcac-f7b7-47d8-af8a-4cd5b1403228","mergeType":"NO_MERGE","interactionType":"sync"}
{"siteNumber":1232,"trackId":"fe09d818-5c21-43d2-a70b-049984862be7","timestamp":1614178234553,"eventId":"a6407a91-76af-11eb-91ec-a38b45b97fab","partnerNumber":2001,"partnerCookie":"ID123","mergeType":"SITE","interactionType":"sync"}Filter export data
By default, the historic event export includes all events, which can result in very large files even when compressed. To reduce the file size, you can use query filtering based on the JSON format of the data.
Build a query
You can query on any value within the JSON object. Every query starts with interaction, which represents the JSON line itself. Use dot notation to access nested fields.
For example, given this JSON line:
{"interactionType":"engagement","type":"category","content":"","variables":{"categoryid":"251"},"siteNumber":1001,"timestamp":1436434343609,"trackId":"322add73-3348-4c51-839d-139156a14f4c"}You can filter using any of the following queries:
interaction.interactionType=="engagement"interaction.type == "category"interaction.variables.categoryid == "251"interaction.interactionType=="engagement" && timestamp > 1436434343600Note:
When using the
&&(and) operator, the query matches fields within the same JSON line. To get information from separate events, use the||(or) operator instead.
Query examples
Search by trackId
Returns all events for a specific track ID.
interaction.trackId=="049fbeab-b561-4cc5-971a-e44012b96fa6"Search by interaction type
Returns all sessionStart, engagement, and conversion events.
interaction.interactionType=="sessionStart" || interaction.interactionType=="engagement" || interaction.interactionType=="conversion"Search engagements by properties
Returns all productView engagements where the tripCode property equals br_GIG-AMS.
interaction.interactionType=="engagement" && interaction.type=="Product View" && interaction.variables.tripCode=="br_GIG-AMS"Search session starts by partial URL
Returns all sessionStart events where the URL property matches a specific regex pattern.
interaction.interactionType=="sessionStart" && interaction.url =~ ".*demoshop92.relay42-demo.com.*"Search for mapping content
Returns all sync events where the partner number is 2001 and the merge type is NO_MERGE.
interaction.interactionType=="sync" && interaction.partnerNumber == "2001" && interaction.mergeType == "NO_MERGE"