Campaign activity export using webhooks

Blueshift can export a campaign activity each time your customer interacts with a marketing message. Our platform sends a webhook notification when your customer opens, clicks, or unsubscribes to marketing messages, or if marketing messages bounce or get delivered. You can use this to update analytics or route the data to other partners you may be using.

Campaign activity exports are currently offered only on Email and SMS channel, or if your customer's device token is updated. We will extend the option to export campaign activities to other channels in the near future.

We batch these notifications every 1 minute

In order to export campaign activities, go to the Campaign activity exports tab in Account Settings. You'll need to configure:

  • Execution Status Of Transactional Campaigns: Specify a URL where we can send the status of a transaction backed campaign. 
  • Export Messaging Events: Choose whether you want to export campaign activity to a custom webhook URL, or if you want to send it to either Segment.com or mParticle.

    webhook_notifications.png
  • Webhook URL: Specify the webhook URL to which you want to export campaign activity. This option is available when you choose Custom Webhook URL in the Export Messaging Events field.
  • Select events that you want to export: Choose the events that you want to export out of our platform. 

Ensure that you Save your settings.

The notification that we send contains these attributes:

  • action: User's action including open/click/unsubscribed/delivered/spam
  • campaign_name: Campaign name in Blueshift
  • campaign_uuid: Campaign unique identifier
  • customer_id: Identifying information of user that did the action
  • email: Email address of user that did the action
  • IP: IP address of the user
  • trigger_timestamp: Timestamp in is08601 when user did the action
  • user_uuid: Unique UUID of the user in Blueshift
  • UTM*: Various UTM parameters corresponding to the campaign
 

Sample data format

The payload of the webhook callback is batched.

  • JSON
{
"batch": [
    {  
    "action":"open",
    "bucket_uuid":"e211ea94-8da6-43a5-b95b-c21ccfe4568c",
    "campaign_exec_term":"on_going",
    "campaign_id":"0835fbbb-4059-4172-bebc-6aafdaa7b44f",
    "campaign_name":"Abandoned cart",
    "campaign_uuid":"0845bbbb-4059-4172-bebc-6aafdaa7b44f",
    "creative_uuid":"a533de05-1a32-4312-80da-7c5893fbd5a5",
    "customer_id":"12345",
    "email":"username@domain.com",
    "event":"open",
    "experiment_uuid":"ac09f565-9bd9-4f72-b5ea-6a143516f1f4",
    "ip":"198.234.218.145",
    "message_uuid":"3543b535-29ad-4144-a749-2340a5c694f0",
    "trigger_timestamp":"2016-11-22T06:50:14+00:00",
    "trigger_type":"EmailTrigger",
    "trigger_uuid":"577a52f6-0678-4aa2-80f9-f819395aba07",
    "user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:49.0) Gecko/20100101 Firefox/49.0",
    "user_uuid":"9a4df219-e42c-4913-a3d9-917e9fb4dd6d",
    "utm_campaign":"abandoned_cart",
    "utm_content":"product-banner",
    "utm_medium":"email",
    "utm_source":"blueshift",
    "utm_term":null
    },
    ...
    ]
}

Blueshift can send a webhook notification for the users in a campaign across Email/Push/SMS channel, so that you can take care of actual delivery of message.

In order to setup webhook adapter, go to the Setup channels tab in Account Settings and select appropriate channel tab. You'll need to configure:

  • Webhook URL: A URL where webhook notifications should be sent
setup_channels_webhook.png

The webhook notification sends these attributes:

  • email: User's email id
  • subject: Subject line for email
  • content: HTML content for email
  • campaign_name: Campaign name in Blueshift
  • campaign_uuid: Campaign unique identifier
  • channel: Channel to identify (Email in this case)
  • customer_id: Identifying information of user that did the action
  • message_uuid: Message unique identifier in Blueshift
  • trigger_uuid: Trigger unique identifier in Blueshift
  • user_uuid: Unique UUID of the user in Blueshift
  • experiment_uuid: Unique UUID of the experiment in Blueshift
 

Sample data format (Email)

  • JSON
{
"email":"username@domain.com",
"subject":"Your subject line",
"content":"<!DOCTYPE html><html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"width=device-width\" /><style>#main{background:#fff;min-height:400px;padding:10px;font-family:arial,helvetica,sans-serif}</style><body><div id=\"main\"><p>Hello World</p></div><img src=\"http://0.0.0.0:3000/track?uid=39dac830-77ce-4988-b52a-9cd4e68b2320&amp;mid=8d23a9f8-5c6e-4683-ad8e-c4154fc8720b&amp;eid=0290f45a-8977-46c5-b556-509db7ae02ba&amp;a=open\" /></body></html>",
"campaign_name":"campaign_name",
"campaign_uuid":"3c52e072-67ca-4352-b825-9f52fae15789",
"channel":"email",
"customer_id":"123456",
"message_uuid":"8d23a9f8-5c6e-4683-ad8e-c4154fc8720b",
"trigger_uuid":"780fc20c-6ba0-4aae-81f8-4768531a16ea",
"user_uuid":"f0e8beb6-1927-11e7-93ae-92361f002671",
"experiment_uuid":"f8aa23ba-1927-11e7-93ae-92361f002671"
}

The webhook notification sends these attributes:

  • device_type: Device type (apple or android)
  • device_token: APNS or GCM token
  • payload: Content JSON
  • campaign_name: Campaign name in Blueshift
  • campaign_uuid: Campaign unique identifier
  • channel: Channel to identify (Email in this case)
  • customer_id: Identifying information of user that did the action
  • message_uuid: Message unique identifier in Blueshift
  • trigger_uuid: Trigger unique identifier in Blueshift
  • user_uuid: Unique UUID of the user in Blueshift
  • experiment_uuid: Unique UUID of the experiment in Blueshift
 

Sample data format (Push)

  • JSON
{
"device_type":"android",
"device_token":"ABCDEFGHYJKLMNOPQRSTUVWXYZ",
"payload":
  {
  "notification":
    {
    "title":"Hello World"
    }
  },
"campaign_name":"campaign_name",
"campaign_uuid":"3c52e072-67ca-4352-b825-9f52fae15789",
"channel":"email",
"customer_id":"123456",
"message_uuid":"8d23a9f8-5c6e-4683-ad8e-c4154fc8720b",
"trigger_uuid":"780fc20c-6ba0-4aae-81f8-4768531a16ea",
"user_uuid":"f0e8beb6-1927-11e7-93ae-92361f002671",
"experiment_uuid":"f8aa23ba-1927-11e7-93ae-92361f002671"
}

The webhook notification sends these attributes:

  • phone_number: User's phone number
  • message: Text message
  • campaign_name: Campaign name in Blueshift
  • campaign_uuid: Campaign unique identifier
  • channel: Channel to identify (Email in this case)
  • customer_id: Identifying information of user that did the action
  • message_uuid: Message unique identifier in Blueshift
  • trigger_uuid: Trigger unique identifier in Blueshift
  • user_uuid: Unique UUID of the user in Blueshift
  • experiment_uuid: Unique UUID of the experiment in Blueshift
 

Sample data format (SMS)

  • JSON
{
"phone_number":"919876543210",
"message":"Hello World!",
"campaign_name":"campaign_name",
"campaign_uuid":"3c52e072-67ca-4352-b825-9f52fae15789",
"channel":"email",
"customer_id":"123456",
"message_uuid":"8d23a9f8-5c6e-4683-ad8e-c4154fc8720b",
"trigger_uuid":"780fc20c-6ba0-4aae-81f8-4768531a16ea",
"user_uuid":"f0e8beb6-1927-11e7-93ae-92361f002671",
"experiment_uuid":"f8aa23ba-1927-11e7-93ae-92361f002671"
}

Contact support@getblueshift.com to enable device token updates in case you're using Blueshift's mobile SDK.

The webhook notification sends these attributes:

  • action: "update_device_tokens"
  • event: "update_device_tokens"
  • deleted_tokens: List of invalid device tokens which were deleted
  • updated_tokens: List of old and corresponding updated device token
  • user_uuid: Unique UUID of the user in Blueshift
  • customer_id: Identifying information of user that did the action
  • JSON
{
  "batch": [
    {
      "event":"update_device_tokens",
      "action":"update_device_tokens",
      "deleted_tokens":["APA91bEsiO41tsro2ixl6ii-Tk8lLRZmBDlQdtM7Zvz_TE1zQodobqfYDTZ2xKueuVZxFsg3fJCT0KH3UGvUb--2iHk6PxVqEn5hfHAAIzJMkRCVuPx_gX9IcvzDtyVA9yccXKIi0BZ2FFd2DPF_-Oe9LmGJ2MUzhA"],
      "updated_tokens":[],
      "user_uuid":"82bb3b68-8504-4ef4-86d0-f789422c2b59",
      "customer_id":"1348766"
    },
    {
      "event":"update_device_tokens",
      "action":"update_device_tokens",
      "deleted_tokens":[],
      "updated_tokens":[
        {
          "old":"APA91bEsiO41tsro2ixl6ii-Tk8lLRZmBDlQdtM7Zvz_TE1zQodobqfYDTZ2xKueuVZxFsg3fJCT0KH3UGvUb--2iHk6PxVqEn5hfHAAIzJMkRCVuPx_gX9IcvzDtyVA9yccXKIi0BZ2FFd2DPF_-Oe9LmGJ2MUzhA",
          "new":"AODKEqdejd@ro2ixl6ii-Tk8lLRZmBDlQdtM7Zvz_TE1zQodobqfYDTZ2xKueuVZxFsg3fJCT0KH3UGvUb--2iHk6PxVqEn5hfHAAIzJMkRCVuPx_gX9IcvzDtyVA9yccXKIi0BZ2FFd2DPF_-Oe9LmGJ2MUzhA"
        }
      ],
      "user_uuid":"82bb3b68-8504-4ef4-86d0-f789422c2b59",
      "customer_id":"284922"
    }
  ]
}
Was this article helpful?
0 out of 0 found this helpful