- [Home page](https://www.brimit.com/)
- [Blog](https://www.brimit.com/blog)

# Dive into Sitecore CDP - How to connect Sitecore CDP to website

[Tech Talks](https://www.brimit.com/blog?categories=Tech%20Talks) [DXP](https://www.brimit.com/blog?platforms=DXP)
[Sergey Baranov](https://www.brimit.com/blog/author?authors=Sergey%20Baranov) on October 1, 2021

First of all, if you don`t have **Sitecore CDP app** account, please, follow instructions in my previous article to get access to Sandbox environment.

1. Login to Sitecore CDP app, navigate to **System Settings -&gt; API Access** and copy **Client Key** value: ![Sitecore CDP Client Key](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/client_key.png)
2. In Sitecore CDP app navigate to **System Settings -&gt; Points of Sale** and create new point of sale with values that match your website hostname: ![Sitecore CDP - Create Point of Sale](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/point_of_sale.png)
3. Insert javascript snippet to your website layout and **replace client\_key, pointOfSale, cookie\_domain** with your values:

    ```

    <script type = "text/javascript">
        var _boxeverq = _boxeverq || [],
            _boxever_settings = {
                client_key: "xxxxxxxxxxxxxxxxx",
                target: "https://api.boxever.com/v1.2",
                cookie_domain: ".website.com",
                pointOfSale: "website.com",
                web_flow_target: "https://d35vb5cccm4xzp.cloudfront.net"
            };
    ! function() {
        var e = document.createElement("script");
        e.type = "text/javascript", e.async = !0, e.src = "https://d1mj578wat5n4o.cloudfront.net/boxever-1.4.8.min.js";
        var t = document.getElementsByTagName("script")[0];
        t.parentNode.insertBefore(e, t)
    }() < /script>

    ```

    One more important variable is **web\_flow\_target**. It is missing in some examples from documentation. If you don`t have this variable – your experiences *(that you create in CDP app)* will be NOT displayed on your website.

    Your connection with Sitecore CDP is ready! It is time to test it.
4. To test your connection you should trigger **\_boxeverq.push** function in your website javascript:

    ```

    // Place an anonymous function in the Boxever queue
    _boxeverq.push(function() {
        var viewEvent = {
            "browser_id": Boxever.getID(),
            "channel": "WEB",
            "type": "VIEW",
            "language": "EN",
            "currency": "EUR",
            "page": "/home",
            "pos": "website.com"
        };
        //Add UTM params
        viewEvent = Boxever.addUTMParams(viewEvent);
        // Invoke event create
        // (, , )
        Boxever.eventCreate(viewEvent, function(data){}, 'json');
    });

    ```

    Make sure that **pos** variable value match your hostname and CDP`s point of sale. Here is example of my extention that I use for event triggering:

    ```

    export const sendBoxeverEvent = (type, options, callback) => {
      const { page, currency } = options;

      _boxeverq.push(function () {
        const boxeverEvent = {
          browser_id: Boxever.getID(),
          channel: 'WEB',
          type: type,
          language: getCookie('lang').toUpperCase() || 'EN',
          pos: window.location.host,
          currency: currency || 'EUR',
          page: page || '/'
        };

        Boxever.eventCreate(
          boxeverEvent,
          function (data) {
            if (callback) callback();
          },
          'json'
        );
      });
    };

    // example of usage:
    sendBoxeverEvent('VIEW', {page: window.location.pathname});

    ```
5. Once javascript **\_boxeverq.push** is triggered, you can see JS request with your values to **api.boxever.com** in browser Network tab: ![Sitecore CDP - Inspect Request](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/request_inspector.png)

    If you see this request, this means that yout event was successfully pushed to Sitecore CDP app. ***BUT one note***: if your website visitor is anonymous, you will NOT find this event immideatelly in CPD app at Guest section.

    So, if you want to be 100% sure that your event successfully comes to CDP you can trigger **IDENTITY** request and provide any identifier variables like email:

    ```

    _boxeverq.push(function() {
        var identityEvent = {
            "browser_id": Boxever.getID(),
            "channel": "WEB",
            "type": "IDENTITY",
            "language": "EN",
            "currency": "EUR",
            "page": "/home",
            "pos": "website.com",
            "email": "myemail@gmail.com",
            "firstName": "First",
            "lastName": "Last"
        };

        Boxever.eventCreate(identityEvent , function(data){}, 'json');
    });

    ```

    You can execute this request for testing in your website browser console and make sure that response status is OK: ![Sitecore CDP - Identity request](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/req1.jpg)![Sitecore CDP - Identity response](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/req2.jpg)

Your new user should appeared in **Customer Data -&gt; Guest** section almost immideatelly: ![Sitecore CDP - New Guest](https://www.brimit.com/-/media/project/brimit/blog/2021/x3mxray/1/response.jpg)

If you don`t see your created Guest and your triggered events in **Sitecore CDP** app - just double check that your hostname matches your pos value in your requests and matches *Point of Sale* in **Sitecore CDP**.  This is usually the main reason of connection issues.

*More information about website connection on [Sitecore Knowledge Hub](https://sitecore.cdpknowledgehub.com/docs).*

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
- [Debugging tools](https://www.brimit.com/blog/cdp-2-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&iar=0&w=200&hash=0D636570F87F1C13C39E06EB19D9DF06)

Sergey Baranov

Sitecore MVP/ Senior Sitecore Developer
[Sergey Baranov](https://www.brimit.com/blog/author?authors=Sergey%20Baranov)

###### More By Categories

[#Events](https://www.brimit.com/blog?categories=#Events) [#How-to](https://www.brimit.com/blog?categories=#How-to) [#News](https://www.brimit.com/blog?categories=#News) [#Guides](https://www.brimit.com/blog?categories=#Guides)

###### More by Platform

[Data and AI](https://www.brimit.com/blog?platforms=Data%20and%20AI) [DXP](https://www.brimit.com/blog?platforms=DXP) [E-commerce](https://www.brimit.com/blog?platforms=E-commerce) [Internet of Things](https://www.brimit.com/blog?platforms=Internet%20of%20Things) [Sales and marketing automation](https://www.brimit.com/blog?platforms=Sales%20and%20marketing%20automation)

#### 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-to DXP E-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
[How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects](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-to DXP

##### 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
[Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story](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-to DXP E-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
[Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)](https://www.brimit.com/blog/going-headless-part-2-when-a-headless-cms-is-your-best-bet-if-you-have-sitecore)
