﻿#### 

Sometimes you need to pass additional data to Sitecore CDP. It can be, for example, full information about customer order for *ADD/CHECKOUT* event, or you may be want to store user image in your CDP guest profile. In this article I will show you how to do it.

#### How to pass extended data in CDP event?

It is easy to do. All that you need just to pass any addditional data that you want to **ext** field in your event request. Example for *CHECKOUT* event where we pass information about guest order and custom **facebook\_event\_id** field:

Helper for event triggering:

```

export const sendBoxeverEvent = (type, options, callback) => { 
  const { page, currency, ext } = options; 
 
  _boxeverq.push(function () { 
    const boxeverEvent = { 
      browser_id: Boxever.getID(), 
      channel: 'WEB', 
      type: type, 
      language: 'EN', 
      pos: window.location.host, 
      currency: currency || 'EUR', 
      page: page || '/', 
      ext: ext, 
    }; 
 
    Boxever.eventCreate( 
      boxeverEvent, 
      function (data) { 
        if (callback) callback(); 
      }, 
      'json' 
    ); 
  }); 
};

```

Example of execution:

```

sendBoxeverEvent('CHECKOUT', { 
 page: window.location.pathname,  
 ext: { 
   facebook_event_id: "df2e518d-5004-43b2-b53c-5e6a0021dede", 
   cart:[{ProductID:"M00003", Quantity:6, UnitPrice:37}], 
   total:345.45
 }
});

```

This event will be send to CDP and stored in format:![Sitecore CDP - Checkout event](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/3/checkout.jpg)

#### How programmatically get extended event data?

You just need to select your event and add get extended data by hitting **event.arbitraryData.ext** property.

#### How to store extended data in guest profile?

First of all, before send any data to guest profile need to setup **Authorization Basic** header for your requests. Otherwise you will receive an error:

```

{
    "status": 401,
    "code": 401,
    "message": "Authentication required.",
    "developerMessage": "Authentication with a valid API Key and API Secret is required.",
    "moreInfo": "mailto:support@boxever.com"
}

```

In your CDP account navigate to **System Settings -&gt; API Access** and copy **Client Key** and **API Token** values. You can generate valid auth header by using [this online tool](https://www.blitter.se/utils/basic-authentication-header-generator), use **Client Key** as ***Username*** and **API Token** as ***Password***. Or you can generate it in your javascript yourself, basic auth pattern is: 

```
(`${username}:${password}`).toString("base64")
```

If you don`t know you current Guest Id value, you can find your Guest CDP-address by email with GET request to **https://api.boxever.com/v2/guests?email=userbuyer1@test.com** endpoint with valid auth header: ![Sitecore CDP - Find user by email](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/3/search_by_email.png)

In response you will find link to your Guest. To send extended data to Guest profile you need to make POST request **https://api.boxever.com/v2/guests/{your\_guest\_id}/extExt** endpoint with JSON body in **{key: "", value:""}** format. Example how to add **logo** property to Guest profile to store user photo: ![Sitecore CDP - Send guest extended data](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/3/logo.jpg)

If your request is successfull, you can navigate to CDP **Guest properties** and find your posted value in **Ext** field:![Sitecore CDP - Guest extended properties](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/3/ext.jpg)

#### How programmatically get extended profile data?

You just need to iterate guets data extensions and select your one by key. For our example with logo:

```

for (var i = 0; i < guest.dataExtensions.length; i++) {
 if (guest.dataExtensions[i].name === 'Ext' && guest.dataExtensions[i].key === 'logo') {  var logoExt = guest.dataExtensions[i].values;  return logoExt.url;}
}

```

Here goes the table of contents for my Sitecore CDP blog series:

- [Introduction](https://www.brimit.com/blog/cdp-0-intruduction)
- [How to connect Sitecore CDP to website](https://www.brimit.com/blog/cdp-1-how-to-connect-to-website)
- [Debugging tools](https://www.brimit.com/blog/cdp-2-debugging-tools)
- How to pass extended data to Sitecore CDP
- [How to use Data System connections (Decision model with Content Hub products)](https://www.brimit.com/blog/cdp-5-how-to-use-data-system-connections)
- [How to use AI connections (Web experience with Azure Cognitive Services)](https://www.brimit.com/blog/cdp-4-how-to-use-ai-connections)
- [How to use Destination connections (Triggered experience webhook)](https://www.brimit.com/blog/cdp-6-how-to-use-destination-connections)
- How to use External service connections (Flows with External Service)
- Remarketing with Sitecore CDP and Facebook Ads

###### Author

[!\[sergey-200\](https://www.brimit.com/-/jssmedia/feature/blogs/authors/sergey-200.jpg?h=197&amp;iar=0&amp;w=200&amp;hash=0D636570F87F1C13C39E06EB19D9DF06)
Sergey Baranov
Sitecore MVP/ Senior Sitecore Developer](https://www.brimit.com/blog/author?authors=Sergey%20Baranov)

#### More on Sitecore

[!\[How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2024/vercel_cover-image.png)
#Guides#How-toDXPE-commerce
##### How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects
Optimize and accelerate the development and deployment of complex multisite Sitecore projects.
Alexei Vershalovich on July 17, 2024](https://www.brimit.com/blog/how-vercel-will-help-you-save-effort-when-deploying-sophisticated-sitecore-projects)

[!\[Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2023/sitecore-mentoring---cover-image.png)
#How-toDXP
##### Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story
How to participate in the Sitecore Mentor program and help younger colleagues jump-start a career in Sitecore development.
Sergey Baranov on October 2, 2023](https://www.brimit.com/blog/training-up-tomorrows-sitecore-mvps)

[!\[Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2022/headless/adobestock_456986731.jpg)
#How-toDXPE-commerce
##### Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)
Discover how a headless CMS can benefit organizations that use Sitecore.
Daniil Raschupkin, Palina Trokhautsava on September 15, 2022](https://www.brimit.com/blog/going-headless-part-2-when-a-headless-cms-is-your-best-bet-if-you-have-sitecore)

![](https://bat.bing.net/action/0?ti=187017043&amp;tm=gtm002&amp;Ver=2&amp;mid=447f7fa1-c53f-450a-9e81-29acab3d76f7&amp;bo=2&amp;gtm_tag_source=1&amp;pi=0&amp;lg=en-US&amp;sw=800&amp;sh=600&amp;sc=24&amp;nwd=1&amp;tl=Dive%20into%20Sitecore%20CDP%20-%20How%20to%20pass%20extended%20data%20to%20Sitecore%20CDP&amp;kw=sitecore%20CDP&amp;p=https%3A%2F%2Fwww.brimit.com%2Fblog%2Fcdp-3-how-to-pass-extended-data-to-sitecore-cdp&amp;r=&amp;lt=268&amp;evt=pageLoad&amp;sv=2&amp;asc=D&amp;cdb=AQAY&amp;rn=16576)