<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [ExternalTaggingService](./x-components.externaltaggingservice.md) &gt; [trackAddToCart](./x-components.externaltaggingservice.trackaddtocart.md)

## ExternalTaggingService.trackAddToCart() method

Checks if the session storage contains a result information for a given id or the current url. If exists, it tracks the add to cart and saves the add to cart information into session storage.

**Signature:**

```typescript
trackAddToCart(id?: string): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  id | string | _(Optional)_ The id of the result to track. |

**Returns:**

void

