- [Home page](https://www.brimit.com/)
- [Blog](https://www.brimit.com/blog)

# Sitecore Send Tracking HTTP API

[Tech Talks](https://www.brimit.com/blog?categories=Tech%20Talks) [DXP](https://www.brimit.com/blog?platforms=DXP)
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov) on March 17, 2022

![Moosend logo](https://www.brimit.com/-/jssmedia/images/blog/sitecore-send-1-abandoned-cart/moosend-sitecore_logo_white-back-2.png?h=465&iar=0&w=882&hash=D18699DD3C6618600D6955F478E45C30)

#### Review Sitecore Send Tracking API

In previous blog we talked about configuring Abandoned Cart with Sitecore Send.
The suggested way to implement tracking is to use **Moosend Javascript API**.
There are some **downsides** with it:

- Front end needs to be changed
- Additional tracking library needs to be imported onto site
- It's one more JS integration in addition to default set: Google Analytics, Facebook Pixel and etc.

But it's possible to implement it with [Sitecore CDP](https://www.brimit.com/blog/cdp-0-intruduction). Unfortunately we can't use Javascript Tracking API there. Instead we need implement Tracking without JS API just with **HTTP Requests** with required payload sent to Tracking URLs. Lets take a look how to implement it.

#### Search for sources

The sources of Moosend tracking library can be easily found on [Github](https://github.com/moosend/website-tracking-js).

After some investigation of sources we found [Tracker.ts](https://github.com/moosend/website-tracking-js/blob/5c0e1bdd51928f7e6b33a7ad76060a4233b80917/src/tracker/Tracker.ts) and [config.ts](https://github.com/moosend/website-tracking-js/blob/5c0e1bdd51928f7e6b33a7ad76060a4233b80917/src/common/config.ts).

Basically we can see, that requests are made to `https://t.stat-track.com` host to paths `/identify` or `/track` - based on the event type.

*Note*. It's also file [EXAMPLE-0.4.0.md](https://github.com/moosend/website-tracking-js/blob/master/docs/EXAMPLE-0.4.0.md) in this repository, but it's outdated: wrong payload is provided there.

#### HTTP Requests for Abandoned Cart tracking

Now lets review the request made for each type of event required for Abandoned Cart Tracking.

##### Identify request

This request is made when the user's email is known.

*POST* `https://t.stat-track.com`

```
{
   "ContactEmailAddress":"[USER_EMAIL]",    // users' email
   "ContactId":"[USER_ID]",                 // unique user id
   "actionType":"IDENTIFY",
   "sessionId":"[SESSION_ID]",              // unique session id
   "siteId":"[SITE_ID]"                     // site id from Moosend settings
}
```

The key thing here is known email and user identifiers:

- `ContactId` - unique user identifier, stays the same for multiple user sessions
- `sessionId` - unique session identifier, stays the same per particular user's session, but is different per others user sessions.

`[USER_EMAIL]`, `[USER_ID]`, `[SESSION_ID]` will be used in all others requests.
`[SITE_ID]` is the same for requests for all users in scope of single Moosend integration.

##### Add to cart request

This request is made when user adds something to the shopping cart.

*POST* `https://t.stat-track.com/track`

```
{
   "ContactId":"[USER_ID]",
   "actionType":"ADDED_TO_ORDER",
   "sessionId":"[SESSION_ID]",
   "siteId":"[SITE_ID]",
   "ContactEmailAddress":"[USER_EMAIL]",
   "properties":[                               // information about added to the cart product
      {
         "product":{
            "itemCode":"[PRODUCT_ID]",          
            "itemPrice":10,                     // product price - decimal
            "itemQuantity":2,                   // added quantity
            "itemTotalPrice":20,                // itemPrice * itemQuantity
            "itemUrl":"[PRODUCT_URL]",
            "itemName":"[PRODUCT_NAME]",
            "itemImage":"[PRODUCT_IMAGE]"
         }
      }
   ],
   "Url":"[CURRENT_PAGE_URL]"
}
```

##### Order completed request

This request is made when the order is completed. Also, list of products needs to be included into the payload:

*POST* `https://t.stat-track.com/track`

```
{
   "ContactId":"[USER_ID]",
   "actionType":"ORDER_COMPLETED",
   "sessionId":"[SESSION_ID]",
   "siteId":"[SITE_ID]",
   "ContactEmailAddress":"[USER_EMAIL]",
   "properties":[
      {
         "products":[
            {
               "itemCode":"[PRODUCT_ID_1]",
               "itemName":"[PRODUCT_NAME_1]",
               "itemPrice":10,
               "itemImage":"[PRODUCT_IMAGE_1]",
               "itemUrl":"[PRODUCT_IMAGE_1]",
               "itemQuantity":2,
               "itemTotalPrice":20
            },
            {
               "itemCode":"[PRODUCT_ID_2]",
               "itemName":"[PRODUCT_NAME_2]",
               "itemPrice":20,
               "itemImage":"[PRODUCT_IMAGE_2]",
               "itemUrl":"[PRODUCT_IMAGE_2]",
               "itemQuantity":3,
               "itemTotalPrice":60
            }
         ]
      }
   ],
   "Url":"[PAGE_URL]"
}
```

#### Upcoming

In the next articles we will keep reviewing Sitecore Send and we'll start implementing integration with Sitecore CDP.

#### Sitecore Send Series

[Abandoned Cart with Sitecore Send](https://www.brimit.com/blog/sitecore-send-1-abandoned-cart)

[Sitecore Send Http API](https://www.brimit.com/blog/sitecore-send-2-http-api)

###### Author

![Igor Zharikov - Senior Sitecore Developer, Sitecore MVP](https://www.brimit.com/-/jssmedia/feature/blogs/authors/igor-zharikov-2.jpg?h=700&iar=0&w=700&hash=292A84E8CB3E5CE57CA743385CFB1464)

Igor Zharikov

Sitecore MVP / Senior Sitecore Developer
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov)

###### 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)
