Matching your schema
Now that we've found the UserEvent type, we have to look at the properties it has.
In our example, there are only 3 properties: id, timestamp and name. id and timestamp will be autogenerated by the system, so the only info we can add is the name. That's what we do when we send a event this way:
But now let's consider that we've added some properties to our schema. For instance, when a user gets to the cart page, I want to track the items which are in his/her cart. Each item will have a brand name and its own name.
Your UserEvent
type should look something like this:
Now if you want to send this information along with your event, you have to match the structure of your schema, the name of your event being the 1st parameter in the push method, and the 2nd parameter containing all non system-generated properties (remember: UserEvent
id and timestamp will be autogenerated).
Last updated