Onboarding offline purchase data (such as physical store purchases) to Dynamic Yield enables you to serve personalized experiences to your visitors (or email subscribers) based on their offline activity. You can onboard purchases with a user identifier, or they can be anonymous (just the transaction information).
Onboarding offline purchase data enables you to:
- Use recommendation algorithms that consider offline behavior, including:
- Popularity: Recommends the most popular products based on both offline and online purchases.
- Purchased Together Offline: Recommends items that were purchased offline, regardless of whether they are now being purchased online.
- Purchased Together Offline & Online: Recommends items that were purchased together offline or online.
- Affinity: Recommends products based on previous user behavior (for offline purchases that include identifiers).
- Recently purchased: Recommends products based on the visitor's recent purchases.
- Last Purchased: Recommends products based on the visitor's last purchase.
- Create audiences or target users based on their offline purchases, using the condition Product purchased offline.
- Enrich user affinity profiles based on both their online activity and offline purchases.
- Personalize emails based on both the user's online and offline activities (also supported for users without online activity). Requires an Opted-in Email Addresses feed.
- Export audiences based on their offline purchases (also supported for users without online activity). Requires Opted-in Email Addresses feed.
Upload the offline feed at least once a week so that product recommendations are based on recent transaction data.
To enable these features, contact your Customer Success Manager.
Uploading identified offline transactions
You can synchronize a feed containing offline transactions from identified users: Create a CSV file containing the transactions, and synchronize it as a Dynamic Yield data feed of type Identified Offline Purchases.
To match identified offline purchases with online users, a common unique identifier is required. This is accomplished by sending Omni-Channel events such as Login, Signup, and Identify User, and then including the same identifier when you upload the offline transactions, as described:
Prepare the File
See Sample CSVs for offline transactions to download a sample file |
Create a CSV file that contains the columns described in the following table, using commas as separators. No specific naming convention is required:
- File type: CSV
- Maximum number of rows: 1.5M
- Each line should include one SKU of an offline purchase:
- If a purchase includes 3 SKUs, use 3 rows (1 SKU per row).
- If a purchase includes 1 SKU that was purchased 3 times, use a single row and use the "quantity" attribute.
Property | Description | Type |
---|---|---|
cuidType |
The type of identifier used to identify the user. The value should be one of the following:
|
String (Up to 64 characters) |
cuid | The unique identifier of the user who made the purchase. | String (Up to 64 characters) |
transactionId |
The purchase transaction ID. Each line contains a maximum of one SKU. If multiple items were purchased together, create multiple lines with the same transactionId. The transaction ID must be unique per transaction, including online purchases. A transaction with the same ID as another transaction previously ingested within the past day is ignored. |
String (Up to 64 characters) |
transactionSource (optional) |
The source where the transaction occurred, usually the physical store ID. | String |
transactionDatetime | The date and time of the purchase in ISO 8601 combined date and time format. For example, 2018-09-23T07:29:51+00:00. | String |
value | Total cart value in actual payment currency. Required if transactionItemValue is not defined. Otherwise, it's optional. | Float (dollars.cents, positive values only) |
currency | If the transaction isn't in your default currency, specify the currency here. For more information, see Multi-Language Support. | String |
productId | SKU exactly as it appears in the product feed. If the SKU is not in the product feed the purchase is not be uploaded. | String |
quantity | How many of the specific item are included in the purchase. | Number (positive, no demimal points) |
itemPrice | List price for each item (quantity of one). This might be different from the transactionItemValue due to discounts, taxes, and so on. | Float (dollars.cents, positive values only) |
transactionItemValue |
Value of the line item in actual payment currency. The value is the product of itemPrice times quantity, after discount and taxes. Negative values are ignored. |
Float (dollars.cents, positive values only) |
size (optional) |
The size of the item. |
String |
The file should not include duplicate rows and should be sorted by transactionId. Each row represents a purchased SKU. A single transaction including 2 identical shirts for $20 dollars each (discounted from $25 list price), and one jacket for $100, there would be two lines in your CSV with the following values:
transactionId | transactionDateTime | value | currency | productId | quantity | itemPrice | transactionItemValue |
---|---|---|---|---|---|---|---|
101 | 2018-09-23T07:29:51+00:00 | 140.00 | USD | 12345 | 2 | 25.00 | 40.00 |
101 | 2018-09-23T07:29:51+00:00 | 140.00 | USD | 12789 | 1 | 100.00 | 100.00 |
When you sync the feed, a purchase event is fired according the transactionID. Two instances of the same transaction following each other trigger only 1 purchase event with 2 products in the cart, but if the same transactionID appears twice, separated from each othe by other transactionIDs, a purchase event is triggered for each transaction separately.
For example:
#1 | transactionID_1 transactionID_1 |
Result: 1 purchase event with 2 products |
#2 | transactionID_1 transactionID_2 transactionID_1 |
Result: 3 purchases events |
#3 |
transactionID_1 |
Result: 2 purchase events (1 with 2 products, 1 with a single product) |
Upload the File
- In the Experience OS console, go to Assets › Data Feeds.
- Click Add New and select Identified Offline Purchases.
- Select CSV as the sync method.
- Write down the displayed S3 credentials.
- Save and Activate the Data Feed.
- At any time, upload a new feed file to a folder in your S3 bucket, as follows: <s3 bucket URL>/YYYY-MM-DD/
The feed file can have any name, but cannot include the "-" (dash) character.
A new folder must be created for every day that you synchronize the file. Whenever a new file is uploaded, Dynamic Yield ingests it immediately. - You can check the synchronization status and check for errors by looking at the Data Feed list and downloading the log. For more details, see File Error Handling below.
Note: It can take up to 24 hours for identified users' profiles to be updated with the offline purchase information you imported into the account.
Note: In order to be included in Audience Reports, the identified offline purchases must match identified online users; however, users who haven't had any online activity can still receive personalized email experiences and be included in audience exports.
Uploading anonymous offline transactions
To sync offline purchases without any user identifiers, do the following:
Prepare the File
See Sample CSVs for offline transactions to download a sample file |
- File type: CSV
- Filename: anonymousofflinepurchases.csv (recommended. Special characters might not be supported)
- Maximum number of rows: 1.5M
- Each line should include one SKU of an offline purchase:
- If a purchase includes 3 SKUs - use 3 rows (1 SKU per row).
- If a purchase includes 1 SKU that was purchased 3 times - use a single row and use the "quantity" attribute.
Format:
Property | Description | Type |
---|---|---|
transactionId | Unique transaction ID for a purchase including one or more items. If more than one type of item was purchased, there should one line in the CSV for every unique SKU included in the purchase. For more details, see the example below. | String (Up to 64 characters) |
transactionSource Optional |
The source where the transaction occurred, usually the physical store ID. | String |
transactionDatetime | The date and time of the purchase in ISO 8601 combined date and time format (for example, 2018-09-23T07:29:51+00:00). | String |
value |
Total value of the purchase (with its entire content). |
Float (dollars.cents, positive values only) |
currency | The currency that the value column of the specific purchase is based on. | String See supported currencies |
productId | The item SKU exactly as it appears in the product feed. If the SKU is not in the product feed the purchase is not uploaded. | String |
quantity | How many of the specific item there are within the purchase. | Number (positive, no decimal points) |
itemPrice | List price for every single item (quantity of one). This may be different from the transactionItemValue due to discounts, taxes, and so on. | Float (dollars.cents, positive values only) |
transactionItemValue |
Value of the line item in actual payment currency. The value is the product of itemPrice times quantity, after discount & taxes. |
Float |
size (Optional) |
The size of the item. For example, L, M, or any way you would like to describe the size of your products. |
String |
The file should not include duplicate rows and should be sorted by transactionId. Each row represents a purchased SKU. A single transaction including 2 identical shirts for $20 dollars each (discounted from $25 list price), and one jacket for $100, there would be two lines in your CSV with the following values:
transactionId | transactionDateTime | value | currency | productId | quantity | itemPrice | transactionItemValue |
---|---|---|---|---|---|---|---|
101 | 2018-09-23T07:29:51+00:00 | 140.00 | USD | 12345 | 2 | 25.00 | 40.00 |
101 | 2018-09-23T07:29:51+00:00 | 140.00 | USD | 12789 | 1 | 100.00 | 100.00 |
When you sync the feed, a purchase event is fired according the transactionID. Two instances of the same transaction following each other trigger only 1 purchase event with 2 products in the cart, but if the same transactionID appears twice, separated from each othe by other transactionIDs, a purchase event is triggered for each transaction separately.
For example:
#1 | transactionID_1 transactionID_1 |
Result: 1 purchase event with 2 products |
#2 | transactionID_1 transactionID_2 transactionID_1 |
Result: 3 purchases events |
#3 |
transactionID_1 |
Result: 2 purchase events (1 with 2 products, 1 with a single product) |
Upload the File
- In Dynamic Yield, go to Assets › Data Feeds.
- Click Add New and select Anonymous Offline Purchases.
- Select CSV as the sync method.
- Write down the S3 credentials that are displayed.
- Save and Activate the Data Feed.
- Upload a new feed file any time to a folder in your S3 bucket as follows: <s3 bucket URL>/YYYY-MM-DD/
The feed file can have any name, but cannot use the "-" (dash) character.
A new folder must be created for every day that you sync the file. Whenever a new file is uploaded, Dynamic Yield will ingest it immediately. - You can check the synchronization status and check for errors by looking at the Data Feed list and downloading the log. For more details, see File Error Handling below.
If you have more than one Dynamic Yield site, we recommend uploading the offline purchase data to the most relevant site and sharing the audience to all of your other sites. Alternatively, you can also upload the offline purchase data to each of your sites individually.
Uploading the file using CLI
- Run AWS configuration in the desired directory: aws configure
- Use your Access Key ID
- Use your Secret Access Key
- Under region, enter us-east-1 if you use the US data center, or eu-central-1 for the EU data center.
- Default output format: You can leave this blank (just press Enter).
- Run the following command to upload your file:
aws s3 cp name_of_the_file.csv <s3_bucket_URL>/YYYY-MM-DD/name_of_the_file.csv - Verify that the file is in S3:
aws s3 ls <s3 bucket URL>/YYYY-MM-DD/
Note: Make sure to use the slash ( / ) at the end of this address, to avoid an access error.
File error handling
Several validations are performed when a file is synchronized, and an error file is created with all the rows with errors, and an additional column with the relevant error message. You can download the error log directly in the Data Feeds list. For more details, see Validating Your Web Implementation. The validations check that the following are true:
- File isn’t empty.
- Mandatory columns (for example, transactionId, productId) are not missing from the file.
- No negative values for certain fields (value, transactionItemValue, Item Price, quantity).
- The TRANSACTION_DATE is a valid date.
The error file is uploaded to the same folder as the file you are synchronizing. It is named <Feed name>-Feed-Log-MM-DD-YYYY-HH-MM-SS.
If more than 20% of the rows contain errors, the file is not synchronized and will be marked with the error: “synced with error”. Files with fewer than 20% errors are synced with the status “synced with warnings”.
Duplicate transactionId
If 2 files are imported and contain the same transactionId within 24 hours, the related purchases of the 2nd file are ignored. After that, the purchase events are stored.
Validating
After you import the offline purchases, go to the Audience Explorer and filter users by "Products purchased offline". Make sure you see users.
Note: This process is applicable to identified users only. The Anonymous feed doesn't include any identification, so data isn't attributed to actual users.
If you do not see any users, make sure that the following have occurred:
- The offline purchases feed has been synced successfully.
- The identifier used in the offline purchases feed is the same identifier you use on your site.
What can you do with offline purchase data?
- Create audiences based on offline purchases and target them in relevant campaigns.
- Serve personalized recommendations using the "User Affinity" algorithm, which takes into consideration the offline purchases as well.
- Use the Purchased Together - Offline or Purchased Together - Offline and Online to leverage your offline data, in case you have a large amount of offline data.
- Avoid recommending products that the user already purchased offline.
- For every item purchased offline, an offline purchase event is fired. You can query these events in the audience explorer module.
Known limitations
- Each file can include a maximum of 1.5M rows.
- If you require more than 1.5M rows, you can upload multiple files a day, but make sure you wait until the previous upload is completed (this can take several hours, depending on the file size).
- Up to 100 files can be uploaded daily