@empathyco/x-components
Version:
Empathy X Components
55 lines (26 loc) • 960 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
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
id
</td><td>
string
</td><td>
_(Optional)_ The id of the result to track.
</td></tr>
</tbody></table>
**Returns:**
void