A Personalization upload file includes two sections to describe its data: a header section and a data section.
Header section
The header for the upload file consists of two lines:
A pipe-delimited (
|
) list of the import element fields you want to use. There are 4 headers (marked as Required in the following table) which must be on the same line. The other headers aren’t mandatory and can be excluded if not needed.Note
The version header is now an optional line and will be ignored if not supplied.
Field name | Description | Data type | Required |
---|---|---|---|
event_date | Event date and time in UTC (Example: 2014-08-27 11:25:00.155) | Date (YYYY-MM-DD HH:mm:ss.sss) | No |
event_name | Event name corresponding to the captured information. The event name must be already created in Personalization (see note) (Example: Content View ) | String | Yes |
event_source | Source of the event (Example: Call Center ) | String | Yes |
identity | Visitor’s identity information (Example: [email protected] ) | String | Yes |
identity_source | Type of visitor’s identity information (Example: email ) | Specific string (account, email, facebook, name, twitter ), or tracking | Yes |
ip_address | Visitor’s IP address (Example: 76.9.215.214 ) | IPv4 address | No |
referral_url | Referrer’s URL (Example: http://www.example.com/homepage ) | String | No |
touch_id | Internal identifier for the touch (Example: CALL1920 ) | String | No |
url | Event’s URL (Example: http://www.example.com/somepage ) | String | No |
user_agent | Visitor’s user agent (Example: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0 ) | String | No |
engagement_score | Number you have chosen to signify the importance of a visitor’s interest in this event (Example: 100 ) | Integer | No |
site_id | customer site ID; must match to the external ID of an entry in the customer site table | String | No |
personalization_goal_name | The name of the goal reached | String | No |
personalization_goal_value | The value of the goal reached | Integer | No |
personalization_name | Name of personalization associated with an event | String | No |
personalization_machine_name | Machine name of personalization associated with an event | String | No |
personalization_chosen_variation | The variation (decision) chosen for an event | String | No |
personalization_audience_name | The name of the audience | String | No |
personalization_decision_policy | The decision policy used (Examples: explore or target ) | String | No |
You can also use the import file to enter information into user-defined fields, where <i>
is the user-defined field you want to use, such as touch_udf3
:
Field name | Description | Data type | Example |
---|---|---|---|
person_udf<i> | User-defined field for a person; accepts up to 50 values (Optional) | String | frequent shopper |
touch_udf<i> | User-defined field for a touch; accepts up to 20 values (Optional) | String | defect |
event_udf<i> | User-defined field for an event; accepts up to 50 values (Optional) | String | follow up |
You can use any ordering for your user-defined fields in the import file and can also omit unused user-defined fields.
You can use the file to import information into custom fields you have added to the Personalization service. Add each custom field’s name to the end of the pipe-delimited list.
Note
- event_name - To import visitor information without associated events or touches, enter
updatePerson
for this field in the data section. When usingupdatePerson
, Personalization imports the following fields for the record:identity
,identity_source
, andperson_udf<i>
. - If the actual data you are importing includes pipes, enclose the data in double quotes to avoid misinterpretation of column values. For example,
My company | a great company
is interpreted as two column values, and"My company | a great company"
is interpreted as a single column value. If the data you are importing already includes double quotes, add a second set of double quotes to each double quote. As an example, while"My company | a "great" company"
is interpreted as two column values,"My company | a ""great"" company"
is interpreted as one column value.
Example
The following example is the header section of an upload file with the 4 required import element fields and an optional field (in this example, engagement_score
):
event_name|event_source|identity|identity_source|engagement_score
Data section
Enter each event you want to upload to Personalization on a separate line in the file, with each of the event’s field separated by a pipe ( |
). The event_name
, event_source
, identity
, and identity_source
fields are required to be in the data section and must have associated values. The identity_source
field must be a specific string as described in the Header section section. Even though Personalization requires three fields in the data section, you must include pipes to indicate the data is null for unused core headers.
Upload file examples
The following page_example
upload file is the most basic upload file template and has only the required data fields.
event_name|identity|identity_source|event_source
Content View|[email protected]|email|web
The following is an example of a more complete import file with more fields set. Blank lines are included for ease of reading. Providing more information for each field helps you to analyze events more comprehensively.
Event_name|event_date|event_source|identity|identity_source|url|referral_url|user_agent|ip_address|content_section|content_keywords
Content View|2014-08-27 11:25:00.155|web|[email protected]|email|http://www.example.com/page1|http://www.example.com/homepage|Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)|90.80.40.225|sport|soccer
Campaign Action|2014-08-27 11:25:00.162|web|My Name|name|http://www.example.com/page1|http://www.example.com/homepage|Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)|81.255.192.149||baseball
Content View||web|1565224|tracking|http://www.example.com/page1|http://www.example.com/homepage|Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36|78.211.126.102|fashion||
Purging a person from the database
The File Import API includes a purgePerson
event type you can use to remove a person from your database. For more information about how to use purgePerson
, see Purging a person from the database.
Importing goal and decision events
The File Import API allows you to import goal and decision information into Personalization. For more information about how, see the Profiles API event_import documentation.