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
You 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 to keep an up-to-date copy of the Talon.One data in your 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
, do the following:- 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
, do the following:- 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
, do the following:- 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 you can tune the sleep interval to balance between the number of API requests performed and the latency of updates to your data warehouse.
Depending on the sophistication of your existing BI tools, you can normalize the nested event/effect data in step 4.1.
To learn more on the structure of events and how to interpret the event.effects
array, see API effects.
If you don't have a data warehouse or cannot automate data exports, read the next section about exporting data manually.
Manually exporting data
If you're automating exports, or for one-time exports, you can manually export customer sessions, triggered effects, and loyalty point transactions.
Customer profiles cannot be manually exported.
Exporting customer sessions
You can export your customer sessions as a CSV file and check specific information about your Application, such as what items were purchased in a certain session, or manually import the data into your data warehouse.
You can export the CSV file in the following ways:
- Programmatically, using the Export customer sessions to CSV file endpoint.
- Using the Campaign Manager, see exporting customer sessions.
Exporting triggered effects
You can export triggered effects as a CSV file and check specific information, such as how many times a given coupon code was redeemed, or manually import the data into your data warehouse.
You can export the CSV file in the following ways:
- Programmatically, using the Export triggered effects to CSV file.
- Using the Campaign Manager, see exporting triggered effects.
Exporting loyalty balances
You can export the point balances of all users of a loyalty program for a given date and time as a CSV file using the Campaign Manager. See the following pages:
Exporting loyalty transaction logs
You can export all loyalty point transactions made by a given customer using the Campaign Manager as a CSV file. See exporting transactions.