Adobe  I/O Adobe Target

Profile Update

A user profile contains demographic and behavioral information of a web page visitor, such as age, gender, products purchased, last time of visit, and so on that Target uses to personalize the content it serves to the visitor.

The profile information for each visitor is either stored in cookies or in third-party apps.

If your web page implements the Target code, the profile information from the cookies is passed to Target using profile parameters. Target identifies each visitor uniquely through a pcID that it generates the visitor’s cookies. However, you can pass profile parameters from an external app through mbox calls using mbox3rdPartyIds.  

Use the profile APIs when you have profile data about your visitors to send to Target that you either can't or don't want to send as part of your page-based integration with Target. This might be data from a CRM or POS that isn't available on the page, or data of a more sensitive nature that does not make sense to pass on the page.

There are two ways to update profiles via API:

  • Single profile API
  • Bulk profile update via batch  

Single Profile Update

Specify the profile parameters in the format profile.paramName=value.
There is a limit of one million profile updates in a 24-hour period.

To update the profile for a pcId, use : 
https://CLIENT.tt.omtrdc.net/m2/client/profile/update?mboxPC=1368007744041-575948.01_00&profile.attr=0&profile.attr2=1...

To update the profile for an mbox3rdPartyId, use:
http://CLIENT.tt.omtrdc.net/m2/client/profile/update?mbox3rdPartyId=123456&profile.attr=0&profile.attr2=1...

The Single Profile Update API is for updates only. If nothing is found, a profile is not created.

Notes   

  • Parameters and values must be URL-encoded using UTF-8.  
  • Parameter format is profile.paramName.
  • Not all parameter values need to exist for all pcIds/mbox3rdPartyId.
  • Parameters and values are case sensitive.
  • Both GET and POST are supported.
  • The current size limitations for limit is 8KB for GET and 60KB for POST.
  • The calls to the profile update API do not count toward your mbox charges.

Response
A sample response for the above requests looks like this:
trueRequest successfully submitted

Notes

  • This response indicates the response has been submitted and will be processed soon. In general, lag time is less than a minute.  

Bulk Profile Update

The Bulk Profile Update API allows you to update user profiles for multiple visitors to a website in bulk using a batch file.

Using Bulk Profile Update API, you can conveniently send detailed visitor profile data in the form of profile parameters for a bunch of users to Target from any external source, including CRM or POS, which isn't usually available on a web page.  

Version URL Example Features
V1 http://CLIENTCODE.tt.omtrdc.net/m2/CLIENTCODE/profile/batchUpdate Support for bulk profile update only
V2 http://CLIENTCODE.tt.omtrdc.net/m2/CLIENTCODE/v2/profile/batchUpdate
  • Create profile if not found
  • Per row status update

Note: Currently, version 2 (v2) of the Bulk Profile Update API is used. However, Target still supports version 1 (v1).  

Authentication

The Bulk Update API call requires a valid access token to be passed in the header of the request.

The access token can be obtained in the following way:

  1. Using the Target Classic UI, go to Configuration > Edit.
  2. Scroll to the bottom of the page.
  3. Under Profile API Settings, switch to ‘Enable’ Require Authorization.
  4. Click Generate Authentication Token.
  5. Copy the token and include it in the request in the header of the
    request in the format: “Authorization” : “Bearer ”

Optionally, use the following API to generate the token:  

Copy
https://admin10.testandtarget.omniture.com/admin/rest/v1/authentication/token?client=clientname&scope=profile_api&email=approver@client.com&password=*****

Alternatively, use the Basic Authorization API as shown in the following curl example below. Basic Authorization header is a base-64 encoded string with the following structure email:password

Copy
'https://admin10.testandtarget.omniture.com/admin/rest/v1/authentication/token?client=clientname&scope=profile_api' -H 'Authorization: Basic bmluYWlyK3N1bW1pdEBhZG9iZXRlc3QuY29tOnN1bW1pdDEyMw=='.

Here is the sample response:

{ "access_token": "b106da37-301d-4cdd-b25f-59ab4c97b5a0", "scope": "profile_api", "expires_in": 21599, "token_type": "bearer” }  

Authorization

Keep in mind the following points about authorization:

  • Authorization is enforced using the user role of the linked Target user to the Marketing Cloud login.
  • Audiences may be created by any user regardless of their role.
  • Audiences that are used in approved campaigns can only be modified by users who have the "Approver" role.  

Batch File

To update profile data in bulk, create a batch file. The batch file is a text file with values separated by commas similar to the following sample file.

batch=pcId, param1, param2, param3, param4
123, value1
124, value1,,, value4
125,, value2
126, value1, value2, value3, value4
 

You reference this file in the POST call to Target servers to process the file. When creating the batch file, bear in mind the following:

  • The first row of the file must specify column headers.
  • The first header should either be a pcId or thirdPartyId. The Marketing Cloud visitor ID is not supported. pcId is a Target-generated visitor
    ID. thirdPartyId is an ID specified by the client application, which is passed to Target through an mbox call as mbox3rdPartyId. It must be
    referred to here as thirdPartyId.
  • Parameters and values you specify in the batch file must be URL-encoded using UTF-8 for security reasons. They can be forwarded to other edge nodes for processing through HTTP requests.
  • The parameters must be in the format paramName only. They are displayed in Target as profile.paramName.
  • If you are using Bulk Profile Update API v2, you need not specify all parameter values for each pcId. Profiles are created for any pcId or
    mbox3rdPartyId that is not found in Target. If you are using v1, profiles are not created for missing pcIds or mbox3rdPartyIds.
  • The size of the batch file must be less than 50MB. In addition, the total number of rows should not exceed 500,000. This limit ensures that servers don't get flooded with too many requests.
  • You can send multiple files. However, the sum total of the rows of all the files that you send in a day should not exceed one million for each client.
  • There is no limit on number of attributes you upload. However, the overall size of a profile including system data should not exceed
    2000KB. Adobe recommends you use less than 1000KB of storage for profile attributes.
  • Parameters and values are case sensitive.  

HTTP Post Request

Make an HTTP POST request to Target edge servers to process the file. Here is a sample HTTP POST request for the file batch.txt using the curl command:

curl -X POST --data-binary @BATCH.TXT http://CLIENTCODE.tt.omtrdc.net/m2/ CLIENTCODE/v2/profile/batchUpdate

Where:   

  • BATCH.TXT is the filename.   
  • CLIENTCODE is the Target client code.   

If you don't know your client code, in the Target UI click Setup > Implementation > Edit Mbox.js Settings. The client code is shown in the Client field.

Response

3. Inspect the response.

v2 returns a profile-by-profile
status and v1 returns only the overall status. The response includes a
link to a different URL that has the profile-by-profile success message.

Response:  

Copy
<response> <success>true</success> <batchStatus>http://mboxedge19.tt.omtrdc.net/m2/demo/v2/profile/batchStatus?batchId=demo-1845664501&m2Node=00</batchStatus> <message>Batch submitted for processing</message> </response>

In case of an error, the response will contain success=false and a detailed message for the error.

A successful response will look like the following:  

Copy
<response>  <batchId>demo-1845664501</batchId>  <profile>   <id>1436187396849-250353.03_03</id>   <status>success</status>  </profile>  <profile>   <id>2403081156529-351655.03_03</id>   <status>success</status>  </profile>  <profile>   <id>2403081156529-351656.03_03</id>   <status>success</status>  </profile>  <profile>   <id>1436187396849-250351.01_00</id>   <status>success</status>  </profile> </response>

Expected values for the status fields are:   

  • success: The profile was updated. If the profile was not found, one was created with the values from the batch.   
  • error: The profile was not updated or created due to a failure, exception, or message loss.   
  • pending: The profile has not been updated or created yet.