What is cart event tracking in SaaS
Tracking cart events helps you understand how users interact with your product. For example, you can record when a user adds an item to their cart to measure engagement and conversion.
What is Operational and tracking events
Operational is an open source event tracking tool for any product. It uses a single API to ingest events from your SaaS. You can use it to log cart events and view them in real time.
Setting up Operational
- Go to app.operational.co and sign up.
- Create a new workspace for your project.
- Navigate to settings and copy your API key.
- Install the SDK in your app with npm or yarn.
Code example
import Operational from "@operational.co/sdk";
const ops = new Operational("API_KEY");
// Add item to cart
const addItemPayload = {
name: "Item Added to Cart",
avatar: "➕",
content: "jane.doe@example.com added 'Wireless Mouse' (ID: 456) to cart"
};
await ops.events.ingest(addItemPayload);
// Remove item from cart
const removeItemPayload = {
name: "Item Removed from Cart",
avatar: "➖",
content: "jane.doe@example.com removed 'Wireless Mouse' (ID: 456) from cart"
};
await ops.events.ingest(removeItemPayload);
// Checkout started
const checkoutPayload = {
name: "Checkout Started",
avatar: "💳",
content: "jane.doe@example.com started checkout with 3 items"
};
await ops.events.ingest(checkoutPayload);
The code above shows how to track adding items, removing items, and starting checkout events in your SaaS.
Conclusion
Using Operational saves you time and hassle by handling event tracking for you. You can focus on building features instead of infrastructure.
Learn more at https://operational.co. Try the playground to copy and paste snippets.