Exporting Talon.One data
You can export data from Talon.One to use it in other marketing tools, run reports or analyze it as part of your BI strategy in case your integration landscape includes an existing data warehouse.
Talon.One also offers reporting on the data it receives as statistics such as campaign performance and customer activity over a time period. You can export this data, depending its type, via one of more of the following options:
- The Campaign Manager's user interface.
- The Integration API.
- The Management API.
In the exported file, all timestamp values follow UTC+00:00
.
In this tutorial, let's export the following types of data:
- Customer sessions
- Customer profiles
- Triggered effects
- Loyalty data
- Loyalty balances
- Loyalty transaction logs
- Projected loyalty balances
We can automate exports of customer sessions, customer profiles and triggered effects. Loyalty data can only be exported manually.
To export loyalty data, create a loyalty program, connect it to the Application and use it in one or more campaigns.
Automating data exports
Let's automate data exports for customer sessions, customer profiles and triggered effects.
Loyalty data can only be exported manually.
This is the recommended option if we want to keep an up-to-date copy of the Talon.One data in our data warehouse.
You can automate the data export using the Management API as follows:
-
Initialize a
lastSync
variable. It represents the last time you exported data.If you already have received events from Talon.One: set this variable to the
created
timestamp of the latest event you received.If no events have been received, set the variable to the
created
timestamp of your Application. Get the timestamp with the List Applications endpoint. -
Create the following empty sets:
profilesToFetch
sessionsToFetch
-
Request all events created after your last sync using the List Applications events endpoint. Set the
createdAfter
query parameter to the value oflastSync
.The response contains an
totalResultSize
property and adata
array containing events. -
For each event in
response.data
:- Store a new
talon_one_event
record in your data warehouse. - If
event.sessionId
is non-zero, add it to thesessionsToFetch
set. - If
event.profileId
is non-zero, add it to theprofilesToFetch
set. - Set
lastSync
toevent.created
.
- Store a new
-
If
response.totalResultSize
is equal to the number of items inresponse.data
:- For each ID in
profilesToFetch
:- Fetch the profile using the List customer profiles matching the given attributes endpoint.
- Store a timestamped
talon_one_profile_snapshot
record in your data warehouse.
- For each ID in
sessionsToFetch
:- Fetch the session using the List Application sessions endpoint.
- Store a timestamped
talon_one_session_snapshot
record in your data warehouse. . Sleep for 1-5 minutes.
- For each ID in
-
Repeat from step 3.
This process can be run continuously, and we can tune the sleep interval to balance between the number of API requests performed and the latency of updates to our data warehouse.
Depending on the sophistication of our existing BI tools, we might want to normalize the nested event/effect data at step 4.1.
To learn more on the structure of events and how to interpret the event.effects
array, see API effects.
If we don't have a data warehouse or cannot automate data exports, let's read the next section to export data manually.
Manually exporting data
If automating exports or for seldom exports, we can manually export customer sessions, triggered effects and loyalty point transactions.
Customer profiles cannot be manually exported.
Exporting customer sessions
We can export our customer sessions as CSV and check specific information about our Application, such as what items were purchased in a certain session, or manually import the data into our data warehouse.
We can export the CSV as follows:
- Programmatically, using the Export customer sessions to CSV file endpoint.
- Using the Campaign Manager, see exporting customer sessions.
Exporting triggered effects
We can export triggered effects as CSV and check specific information, such as how many times a given coupon code was redeemed, or manually import the data into our data warehouse.
We can export the CSV as follows:
- Programmatically, using the Export triggered effects to CSV file.
- Using the Campaign Manager, see exporting triggered effects.
Exporting loyalty balances
We can export as CSV the point balances of all users of a loyalty program for a given date and time using the Campaign Manager. See:
Exporting loyalty transaction logs
We can export as CSV all loyalty point transactions made by a given customer using the Campaign Manager. See exporting transactions.