Importing Historical Data Into Attribution app

❗️

Imported data cannot be deleted!

Once you import data, it cannot be deleted. We recommend that you set up a new project for testing prior to importing you data into production. You can set up a new project on paid plans by clicking on your avatar on the top right of the Dashboard and clicking the "New Project" button.

It is important to note, importing is only useful when capturing events that were missed once Attribution app was installed. Once Attribution app is properly installed importing will be completely unnecessary.

Things that cannot be imported are as follows:

  1. Visitor data
  2. Links or UTM parameters

Below we will discuss how to import historical data into Attribution app:

First, use any server-side library, which send requests in batches to improve performance. Once you have data to import, follow the steps below:

  1. Export or collect the data to be imported.

  2. Send your data to the appropriate endpoints

Use: /track for page views and custom events

Use: /identify for loading or updating user information.

There are a few rules to keep in mind when importing:

  1. When importing it is imperative that every event or page view has either "cookie_id" or "user_id" set; otherwise Attribution app will not be able to track the event.

  2. You cannot use Attribution.track('Loaded a page') as this is reserved and equal to Attribution.page(). Any other name will be considered a custom event.

  3. The "timestamp" property uses the ISO8601 format. It is critical that you set this properly for the time/date that the event occurred.

Example of page view payload:

{
  "cookie_id": "23adfd82-aa0f-8383-a756-24f2a7a4c895",
  "event": "Loaded a Page",
  "properties": {
    "path": "/collections/mens-bottoms-sweatpants",
    "referrer": "https://www.domain.com/cart",
    "search": "",
    "title": "Mens Bottoms Sweatpants".
    "url": "https://www.domain.com/collections/mens-bottoms-sweatpants"
  },
  "timestamp": "2015-12-12T19:11:01.249Z",
  "user_id": null
}

Example of custom event payload:

{
  "cookie_id": null,
  "event": "Order Paid",
  "properties": {
    "revenue": "59.99"
  },
  "timestamp": "2015-12-14T19:09:17.542Z",
  "user_id": 12345
}

Identify calls are not tied to a timestamp and can be sent anytime you want to create or update a record. However, you should call identify() anytime a user signs up or signs in so that we can us it to bind anonymous traffic with known traffic.