@empathyco/x-components
Version:
Empathy X Components
25 lines (14 loc) • 825 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultExternalTaggingService](./x-components.defaultexternaltaggingservice.md) > [trackAddToCart](./x-components.defaultexternaltaggingservice.trackaddtocart.md)
## DefaultExternalTaggingService.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