Events are one of the data points that occur on your site that we want you to import into our platform. Blueshift supports multiple ways of importing events. All the event data in used to create a richer 360 profile of your customers.

Data import methods

You can send events to Blueshift using any of the following methods:

data_events_dec23.png

Bulk upload
Upload CSV from UI Upload event data using a CSV file.
From Amazon S3

Upload event data using a CSV file saved in an Amazon S3 bucket.

From Snowflake

With the integration of Blueshift and Snowflake, you can import event data into your Blueshift account very easily.

Before you can import data from Snowflake you must set up integration of Blueshift with Snowflake and configure at least one adapter.

via Integration Platforms Using these Reverse ETL platforms you can easily copy data from your data warehouse into Blueshift so that your marketing teams can leverage that data to drive action and personalize customer experiences.
APIs Use Blueshift's APIs to send event data to Blueshift.
Data stream
API Use Blueshift's APIs to send event data to Blueshift.
Data platforms Import events data from these data platforms and use the data to update customers.
eCommerce Import events data from these e-commerce stores and use the data to update customers.
From apps Send event data from your apps using Blueshift's Javascript tag and Blueshift's SDKs.

Data types supported

Blueshift supports the following data types:

  • String
  • Integer
  • Date
  • Decimal
  • Boolean data types
  • Array
  • Object (via Snowflake only)

Importing semi-structured data

If you are importing events data from Snowflake, you can import nested data. Consider the following points to understand the types of nested data that can be imported and how it can be used in Blueshift.

1. Simple objects (JSON with no hierarchy or nesting)

You can import Simple JSON data that does not have any hierarchy or nesting. This data can be used for Segmentation and Trigger filters.

{
"Key1":"Value1",
"Key2":"Value2",
"Key3": Value3
}
For example:

{
"House_number": 2,
"Street_name": "Woodbridge Road",
"Locality": "Kesgrave",
"City": "Ipswich"
}

2. Array of primitive data types

You can import arrays of primitive data types. This data can be used for Segmentation and Trigger filters.

[
Value1,
Value2,
Value3
]
For example:

[
"Table",
"Chair",
"Monitor",
]

3. Array of objects

When you import an array of objects, the array is flattened and the data is stored at each key level. If the same key is present in each object, then the key will be stored with multiple values. As a result, during a segmentation or trigger filter query, the results might not provide an accurate result.
Consider the following example:

[
{
"Key1":"Value1",
"Key2":"Value2",
"Key3": Value3
},
{
"Key1":"Value4",
"Key2":"Value5",
"Key3": Value6
},
]
For example:

[
{
"House_number": 2,
"Street_name": "Woodbridge Road",
"City": "Princeton",
"State": New Jersey
},
{
"House_number": 36,
"Street_name": "Benedict Avenue",
"City": "White Plains",
"State": "New York"
}
]

In this example, when the array is flattened, the data is stored as follows:

House_number: {2, 36}
Street_name: {Woodbridge Road,Benedict Avenue}
City: {Princeton,White Plains}
State: {New Jersey, New York}

During segmentation if you run a query for “Street_name=Woodbridge Road AND City=White Plains”, a match will be returned, whereas it does not necessarily match with a single object within the array exclusively.

Note: You can make each object exclusively referenceable by declaring the target datatype as Nested Object. Contact support@blueshift.com for more information.

4. Nested Objects

When you import nested objects, each key is stored as one node. Objects with one level of nesting can be used in segmentation and trigger filters. 

Objects having more than one level of nesting would not be accessible for segmentation or trigger filter conditions.

{
"Outer Key1" : {
    "Inner Key1": "Inner Value 1",
    "Inner Key2": "Inner Value 2"
               },
"Outer Key2": [
     {
     "Inner Key3": "Inner Value 3",
     "Inner Key4": Inner Value 4
     },
    {
    "Inner Key3": "Inner Value 5",
    "Inner Key4": Inner Value 5
    }
    ]
"Outer Key3": Outer Value 1
}
For example:

[
{
“Address”: 
{
"House_number": 2,
"Street_name": "Woodbridge Road",
"City": "Princeton",
"State": New Jersey
},
},
{
“Address”:
{
"House_number": 36,
"Street_name": "Benedict Avenue",
"City": "White Plains",
"State": "New York"
},
}
]

Considerations

Consider the following points about importing event data into Blueshift:

  • Only uppercase letters, lowercase letters, digits, hyphens, underscores, and whitespace are accepted for attribute names. For example, user's_device is an invalid name, but user_device, is a valid name. Also, ensure that event names do not contain periods, are not numeric, and the event name does not have more than 64 characters.
  • Attributes with data type as Boolean cannot be set to a NULL or blank value and must be set as either true or false (lower case). If you require an attribute to have a blank value, use the String data type instead of a Boolean data type.
  • Direct importing of arrays is supported via Snowflake only. When you import customer attributes using a CSV file, use the String data type to import an array.
    For example:
    customer_id,email,flowers
    549765,jane.doe@demo.com,"[""Rose"",""Lotus"",""Jasmine""]"
  • When an array is imported, it is stored as a String. When you are segmenting, you can use "contains" or "equal to any of these" to get the values from the array. 
  • Dates must be in ISO8601 format. For example, 1980-05-19T15:22:01-07:00. 
    • Date can be converted in an Excel file by using a function to add (=A2+TIME(8,0,0) ) or subtract hours (=A2-TIME(8,0,0)) so the time is represented in the UTC time. Replace A2 with the cell of the date you are converting. Please note that this is good for one time uploads as it does not take into account daylight savings for ongoing file uploads. For example: yyyy-mm-ddThh:mm:ss-05:00 for Eastern (Est) timezone. Converting time = A2,5,0,0 will add 5 hours to the time converting EST timezome to UTC.
    • You can also format the date in Excel using custom format to convert the date to ISO8601 format yyyy-mm-ddThh:mm:ss+/-00:00. Replace +/-00:00 with the time zone offset for your timezone.
  • Phone numbers must follow the E.164 standard, contain 6 to 14 digits, and not start with a 0. The phone number must include the country code and start with a +.
    For example, for the subscriber number 4085552346 with Country code 1, the E.164 format is +14085552346. For the subscriber number 2071234567 with Country code 44, the E.164 format is +442071234567.
  • An email address cannot have more than 256 characters.
    For an email address username@subdomain.topleveldomain.com, the following email syntax is acceptable according to RFC standard:
    • The username can have a maximum of 64 characters and can consist of any combination of alphabetic characters, digits, or any of the following special characters: ! # $ % & ‘ * + – / = ? ^ _ ` . { | } ~
    • The topleveldomain can have a maximum of 63 characters, cannot be all numerics and cannot start or end with a hyphen.
    • The subdomain can have a maximum of 64 characters.
    • The domain (for example .com, .gov. .edu and so on) can have a maximum of 63 characters.
  • In order to update customer attributes with the information contained in a custom event, the Enable user updates option must be set for a custom event.
    Note: The Enable user updates option is not available for standard events.

Information in events

  • You must include at least one customer identifier in the event data. In case the customer is anonymous, include the value of the cookie.
  • An event_uuid is assigned to the event in Blueshift. Alternatively, you can include an event_uuid in the event data. This event_uuid must be unique and must be in the format 1234abcd-efghijkj-1234kfjadslk-34iu123. For more information about the UUID format, see RFC 4122.
  • Include a Product ID. If you are including multiple products, the products_ids must be separated by a delimiter.
  • We recommend that you include a timestamp field. If you don't set the timestamp field, Blueshift considers the event's timestamp as the time when the event is imported into Blueshift. Ensure that you provide the timestamp in the ISO8601 format.
  • In addition, you must consider the data formats for any customer attributes and catalogs attributes that you include in the event data.

CSV file to upload data

For some bulk upload methods, you must create a CSV file by including a user identifier (email or customer_id) and a list of event attributes that you want to import. The file must be in Unicode (UTF-8), Unicode (UTF-16), or Western Europe (ISO-8859-1) format.

When you create a task, you can click Download Sample CSV to get the sample data file.

Sample Data:

email product_ids revenue
testuser1@gmail.com SKU0000|SKU1111 120.5
testuser2@gmail.com SKU222|SKU333|SKU5555 112.7

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.