Expand my Community achievements bar.

SOLVED

Importing Purchase Order data into AEP

Avatar

Community Advisor

Hello guys,

 

I am importing a purchase Order into AEP. Any suggestion to build the unique ID (_id), do we have some best practices to be followed? Every experience event must have Point Of Sale ID.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Luca_Lattarini

Before you construct, do consider the below points:

  • purchase orders can be from multiple stores (POS) and from online
  • orders may be stored in multiple systems (depending on scenarios from client)

The best way would be to prefix this sourceId, storeId, and the purchaseId of the order from that store. This will make it unique.

 

Thanks,

Chetanya

View solution in original post

10 Replies

Avatar

Correct answer by
Community Advisor

Hi @Luca_Lattarini

Before you construct, do consider the below points:

  • purchase orders can be from multiple stores (POS) and from online
  • orders may be stored in multiple systems (depending on scenarios from client)

The best way would be to prefix this sourceId, storeId, and the purchaseId of the order from that store. This will make it unique.

 

Thanks,

Chetanya

Avatar

Employee Advisor

@Luca_Lattarini Another thing to consider is if a Purchase Order would ever change (e.g. status)?  If so, remember:

  1. Events are immutable.
  2. It will need to be ingested as a new Event
    1. Any _id strategy will need to accommodate this (e.g. concat(purchaseId + latest updated date) )

Avatar

Community Advisor

Couple more things i could think of 

  • Think on how purchase id/ sale id will work in case of returns and exchanges
  • Check timestamp and ensure it is order/txn timestamp. 

Avatar

Community Advisor

Thanks guys for the very helpful suggestion that I will use. 

I have another question, assuming that i have an event with _id:"1000" email:"xxx", purchased:"shoes model 1" with no timestamp. What happend if  later I ingest another another event with same _id but for example _id:"1000" email:"xxx", purchased:"shoes model 2" .

Is it possible that the last event overrides the previous event  and i will only see the last event ? 

Thanks

 

Avatar

Employee Advisor

@Luca_Lattarini 

  1. "No Timestamp"? 
    1. Sounds like a data quality issue in your source system that needs to be fixed
  2. If a duplicate _id for an Event is loaded into the same dataset (as part of a subsequent Event), it will be ignored or cause an error.

Avatar

Level 1

If a duplicate _id for an Event is loaded into the same dataset , the event will be ignored from the profile store but it will be available in the data lake. So both the events that have shoes model 1 and shoes model 2 will show up in the data lake when you query the dataset using query services . However, only the shoes model 1 event will be associated to the profile when you do a profile lookup.

Avatar

Employee Advisor

Good point... sometimes I focus too much on the Profile, thanks for reminding everyone.

Avatar

Level 3

Thanks everyone for your inputs and clarifications. To extend the above scenario further:

 

I already have one profile record in RT-Customer profile given below:

Profile: ("email": "test@test.com", "shoeSize': "10UK")

 

Both the event schema and profile schema have "email" as the primary identity. The _id is used to identify unique events. Now, if I ingest one more profile fragment for the same email "test@test.com" (shown below), what will my profile lookup for "email" = "test@test.com" return?

 

Profile: ("email": "test@test.com", "shoeSize': "7UK")

 

Thanks!