1

I have a question concerning /contactEvents route in Journey Builder.

I am firing a /contactEvents Event with some custom data (eventStatus field).

The Data extension used for the Event is called "Website_Event" and has the EventInstanceID, ParentEventInstanceID, ContactKey + my custom eventStatus field.

Here is the API call :

 var options = {
        uri: '/contacts/v1/contactEvents',
        retry: true,
        form: {
          "contactKey": "A001",
          "eventDefinitionKey": "ContactEvent-XXXXXXXXXXXXX",
          "data": [{
            "id": "Data_Extension_ID",
            "name": "Website_Event",
            "items": [{
              "values": [{
                "name": "eventStatus",
                "value": "isConnected"
              }]
            }]
          }]
        },
        json: true
    };

This call injects the contact "A001" in the journey that has the EVENT DEFINITION KEY = ContactEvent-XXXXXXXXXXXXX. This EVENT DEFINITION KEY is linked to a data extension (Let's call it Master Data Extension) that has a SubscriberKey, Firstname and Lastname fields.

When I want to configure my decision split, I find under the Event Data all the fields in the Master Data Extension. Under the Contact Event I find the "Website_Event" (which is the destination of the /contactEvents route) but I have no clue on how to make a decision split based on the EventStatus field because I cannot link the EventStatusID with the Subscriber in the Master Data Extension as the relationship between the Contact and the Event data extension is one to many.

I hope I am clear enough :) But tell me if you need more details.

Have a nice weekend,

Zak

UPDATE

Here is the new request I tried based on Eliot's answer.

var options = {
        uri: '/contacts/v1/contactEvents',
        retry: true,
        form: {
            "contactKey": req.body.contactKey,
            "eventDefinitionKey": "ContactEvent-XXXXXXXXXXXXX",
            "data": [{
                "name": "Website_Event",
                "items": [{
                    "values": [{
                        "name": "eventStatus",
                        "value": "isConnected"
                    }]
                }]
            },
            {
                "name": "Event_Status",
                "items": [{
                    "values": [{
                        "name": "ContactKey",
                        "value": req.body.contactKey
                    }, {
                        "name": "status",
                        "value": "isConnected"
                    }]
                }]
            }]
        },
        json: true
            // other request options
    };
  • I assume you mean "EventInstanceID and ParentEventInstanceID", not "EventStatusId and ParentEventStatusId". Please confirm and update your question for clarity. I believe I have a solution for you, but I'll need to test it first — give me a couple of days! – Eliot Harper Feb 17 '17 at 20:42
  • I modified your question to use "EventInstanceID, ParentEventInstanceID" instead of "EventStatusId, ParentEventStatusId" as I think this is what you meant to say! – Eliot Harper Feb 17 '17 at 23:01
  • Hi Eliot, Thank you so much.. Yes i meant "EventInstanceID and ParentEventInstanceID" you can blame friday afternoon... But next time I will be more careful. – zeljazouli Feb 19 '17 at 21:16
1

After some extensive troubleshooting with @zeljazouli over a webinar, I learned that it appears you can no longer include multiple Attribute Sets in your data array. We exhausted every possible permutation in testing this. This certainly used to work when I last tried (which was a couple of years ago), but something has definitely changed along the way.

So I came up with a different solution using Data Binding in the Event Context which we have tested and this works:

  1. Add a field named EventInstanceID to your Event Source DE
  2. Add a Update Contact Data Event to your Journey
  3. Configure the Update Contact Data Event to update Event Source DE field created in step 1 using the value {{Event.Event-Contact-Key-Here.EventInstanceID}}, where 'Event-Contact-Key-Here' is the Event Definition Key of your Event (e.g. ContactEvent-ef18905a-b7c5-d66b-3ca5-d1e939dc394f).
  4. Now that you have a relationship in your Event Source DE linking to the EventInstanceID, you can use this to build your decision split criteria.
  • I confirm that this solution is working like a charm. Thank you Eliot for your time ! – zeljazouli Feb 24 '17 at 10:34
  • Good to hear! Please feel free to up vote my answer if you found it useful. – Eliot Harper Feb 24 '17 at 10:39
0

Decision Splits require a 1:1 Contact Record Relationship. Here's what I would do:

  1. Create a new DE named "Event_Status" with two fields; contactKey and eventStatus. Make contactKey a Primary Key.
  2. Link the DE you created in Step 1 to your Contact model (in Contact Builder), creating a 1:1 relationship to the Contact Record (using the contactKey Attribute).
  3. Set the Decision Split in your Journey to use the eventStatus Attribute from your DE you created in Step 1.
  4. Make the following request:
 var options = {
        uri: '/contacts/v1/contactEvents',
        retry: true,
        form: {
   "contactKey":"A001",
   "eventDefinitionKey":"ContactEvent-XXXXXXXXXXXXX",
   "data":[
      {
         "name":"Website_Event",
         "items":[
            {
               "values":[
                  {}
               ]
            }
         ]
      },
      {
         "name":"Event_Status",
         "items":[
            {
               "values":[
                  {
                     "name":"contactKey",
                     "value":"A001"
                  },
                  {
                     "name":"eventStatus",
                     "value":"isConnected"
                  }
               ]
            }
         ]
      }
   ]
},
        json: true
    };

Notes

  1. You don't need to include the id name/value pair of the DE external key in your data array, only the name value of the DE is required. I've removed this, but you can include it if you really want to.
  2. I'm assuming that the eventStatus field you created in your "Website_Event" DE is nullable, but if it is required, then you can include it in the values array (you just won't be using it).
  • Hi Eliot, Thank you so much for your time. I really appreciate it. I tried your solution following the steps one by one but unfortunately now the data is not inserted neither in the "Website_Event" DE nor in the "Event_Status" DE and thus no contact is injected into the journey. Were you able to insert data in a DE (that is not based on an Event template : Event_Status DE) using the route /contactEvents like you described in your solution? Thank you so much again. – zeljazouli Feb 20 '17 at 17:26
  • Hi @zeljazouli, sorry to hear that you are having issues. Are you sure that your contactKey already exists in All Contacts? If so, let's set-up a brief webinar to review, just pick a time that works for you! – Eliot Harper Feb 20 '17 at 20:30
  • Hi Eliot, yes the ContactKey exists in All Contacts ! I don't know It is not working as I followed your steps thoroughly. I will pick a time now. Thank you again. – zeljazouli Feb 21 '17 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.