The track call lets you record the user’s actions along with any properties associated with them.
Each user action is called an event. Every event has a name associated with it, for example, Product Reviewed. This event can have properties associated with it, like review_id and rating.
It is recommended that events have a descriptive human readable name. This allows everyone (include you 6 months from now) to instantly understand the meaning of an event.
Vague or abstract names like ProdRV and Event2 should be avoided. Instead focus on unique unabiguous names like Product Reviewed and Order Submitted.
A common framework is to use nouns and past tense verbs.
Identity data (user traits) will be automatically added to track calls from the most recent identify call, so you do not need to add it manually. This information will be included in a traits object in the context fields of the payload. Note that track calls also automatically handle anonymousId values associated with the user.
Here is a sample payload for the track event after removing Common fields:
{"type":"track","event":"Product Reviewed","properties":{"review_id":"86ac1cd43","product_id":"9578257311","rating":3.0,"review_body":"OK for the price. It works but the material feels flimsy."}}
The corresponding event that generates the above payload via the JavaScript SDK is:
rudderanalytics.track("Product Reviewed",{review_id:"86ac1cd43",product_id:"9578257311",rating:3.0,review_body:"OK for the price. It works but the material feels flimsy."})
Send a sample track call
Use RudderStack’s Event Playground app to send sample events to RudderStack and test the data flow without any instrumentation.
Click Send to see the API call in the Network tab of your browser’s developer tools.
Click Use My Account in the Event Playground app and specify the write key and data plane URL.
Click Save.
Select the required API Method from the dropdown, edit the relevant fields or traits/properties, and click Send to my account.
To verify the data flow, go to the Live Events viewer of your source.
Track fields
Apart from the Common fields, the track call accepts the following fields:
Field
Type
Presence
Description
event
String
Required
Name of the user action
properties
Object
Optional
Includes the properties associated with the event. For more information, check the Properties section below.
Properties
Properties are additional contextual information that are associated with a track event, that give more clarity of your users’ actions.
RudderStack has reserved some standard properties listed in the following table and handles them in a special manner.
Property
Type
Description
revenue
Number
The revenue amount as a result of an event. For e.g., a product worth $20.00 would result in a revenue of 20.00.
currency
String
The currency of the revenue as a result of the event, set in ISO 4127 format. If this is not set, RudderStack assumes the revenue is in USD.
value
String
An abstract value associated with an event, to be used by various teams.
Different destinations recognize some of the above data points differently.
With RudderStack, you don’t have to worry about these inconsistencies across destinations. Our open source destination transformer code handles these destination-specific conversions automatically.
For example, Mixpanel has a track_charges method for tracking revenue. In this case, you can pass the revenue property and RudderStack will handle the conversion automatically through our destination transformer code. You can see the Mixpanel transformer code in our open source Github repo.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.