Skip to main content
Version: React SDK

Event tracking

Track user actions or events in your application. Events can be used for analytics and targeting surveys to specific user behaviors.

import { useScreeb } from "@screeb/sdk-react";

const ProductPage = () => {
const { eventTrack } = useScreeb();

const handleAddToCart = async () => {
await eventTrack(
"Product added to cart",
{
product_name: "Red bike 2021",
category: "sport",
color: "red",
price: 299,
count: 1,
reference: "2CF093TG1",
delivery_method: "UPS",
user_logged: false,
added_at: new Date(),
}
);
};

return (
<button onClick={handleAddToCart}>
Add to cart
</button>
);
};
Requirements
  • Property names must be limited to 128 characters
  • No more than 1000 attributes
  • Supported types for values: string, number, boolean and Date.