﻿#### 

**Sitecore CDP** provides a lot of tools/options for debugging and in this articles I will show you best of them that I always use during development.

#### Access to user context information.

The easiest way to access to full user context information is to create empty decision model and click **Test Canvas** button.  Once **Test Canvas** tool is opening you just need to find user that you want to test and user information will be loaded automatically:![Sitecore CDP - Debug user context](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/decision_user_context.jpg)

Another way to do it is using *Postman* and **Batch API** of Sitecore CDP. 

Before send any data to **Batch API** you 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")
```

See more information about athentification here: [https://developer.boxever.com/v2.0/reference/authentication](https://developer.boxever.com/v2.0/reference/authentication)

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={user\_email}** 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 for your guest. If you hit *GET* request with Authorization header to this link you will get all information about your user *(the same as by using Test Canvas tool)*:![Sitecore CDP - Batch API](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/postman.jpg)

#### How to debug javascript?

Sirecore CDP has **print** function that is an analogue of **console.log** function of browsers: ![](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/print.jpg)

#### How to debug Decision model nodes?

By using **Test Canvas** tool you can execute your decision model in context of any user and look into **Full Response** tab where you find all information about your model execution and input/output values for each node:

![Sitecore CDP - Decision model response](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/response.jpg)

#### How to debug Web experiences and experiments?

**Sitecore CDP** provides awesome tool for Web experiences and experiments debugging. If you open **Build** tab, click **Preview** button, populate inputs with your website page (you can also optionally add context user) your website page will be opened and you will see **QA Tool** with all statistics and valdations. If something goes wrong during experience execution you will see detailed error in this tool:

![Sitecore CDP - Experience preview](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/experience.jpg)

![Sitecore CDP - QA Tool](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/qa_tool.jpg)

For detailed debugging of your web experience/experiment you can navigate to **Advanced Edit** section and use **Data** tab for execution your exrepience and have access to all entities. Alternatively  you can use **Preview API** button where you see the same but in JSON format: 

![](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/experience_advanced_edit.jpg)

#### How to debug Triggered experiences and experiments?

The first question that you will most likely have when using Triggered experience/experiment is *"How can I access to context event (that I use as a trigger) in linked Decision model"*? This context event information is accessible in **entity** variable. So you can easy use **print(entity);** in your Decision model and then see in **Experience execution** logs format of this entity and use it as an example how to get corresponding field values in javascript. Alternatively you can see **entity** format in **flowExecutionRequestContext** variable in **Experience execution** content:

![Sitecore CDP - Triggered experience](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/2/triggered.jpg)

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
- [How to pass extended data to Sitecore CDP](https://www.brimit.com/blog/cdp-3-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=50e3472c-50e4-4145-95bc-e0dacd764555&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-%20Debugging%20tools&amp;kw=sitecore%20CDP&amp;p=https%3A%2F%2Fwww.brimit.com%2Fblog%2Fcdp-2-debugging-tools&amp;r=&amp;lt=278&amp;evt=pageLoad&amp;sv=2&amp;asc=D&amp;cdb=AQAY&amp;rn=926514)