Event Tracking¶
Track user actions on your website. User actions can be something like the following:
View Page
Add to Cart
Purchase Content
Share Content to Social Network
Tracked events are used as the raw data for the analytics, while also making it possible to segment target users when creating campaigns.
Warning
The maximum number of active events depends on the customer's Repro contract plan.The maximum number of free plans is 50 by default, and in the case of paid plans it is 200 by default.
Please note that if you automatically generate dynamic strings and pass it to
track
, the number of events can easily go up to 200. You can check the number of events currently being used from Settings > Event Settings.
Note
null and empty strings are not allowed for property names. Maximum name length is 48 characters.
You can set String or Number to property's value.
Maximum length is 191 characters for property's value when its type is String.
The following properties are automatically added to all events.
name |
Description |
Example: |
---|---|---|
url | Contains the full URL |
http://docs.repro.io/ja/dev/web/tracking.html?highlight=tracking#web-standard-event |
path | Contains a the URL substring from the domain to the query parameter |
/ja/dev/web/tracking.html |
query | Contains query parameters including '?' |
?highlight=tracking |
referrer | URL of the page being navigated from |
|
title | Page title |
Event Tracking |
Note
Standard Event¶
Repro defines typical events for user behavior analysis as Standard Event. Call the appropriate API when tracking Standard Events. Use Custom Event when you want to track original events on your website.
The following is the list of standard events. Different properties can be specified depending on each event. See the description of each API for more details.
Name |
Description |
Type |
---|---|---|
content_id | ID that specifies the product or the page |
string |
content_name | Name of product or page |
string |
content_category | Category of product or page |
string |
value | Price of product |
double |
currency | Currency unit of value |
string |
num_items | Number of purchases of the same item |
integer |
search_string | Search text submitted by the user |
string |
status | Registration status |
string |
service_name | service name |
string |
Note
Non-required properties are optional
Check Adding custom properties when adding custom properties.
View Content¶
Tracks viewing a content.
Usage
When a user views a product detail page
Properties
content_id (Required, Must be specified as the first argument of the method)
- content_name
- content_category
- value
- currency
reproio("trackViewContent", "1234", {
value: 5000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing"
});
Search¶
Tracks searching for something.
Usage
When a user taps "Search" button
Properties
- content_id
- content_category
- value
- currency
- search_string
reproio("trackSearch", {
value: 3000.0,
currency: "JPY",
content_category: "Clothing & Shoes > Mens > Clothing",
search_string: "Jeans",
content_id: "1234"
});
Add to Cart¶
Tracks adding an item to the cart.
Usage
When a user taps "Add to Cart" button
Properties
content_id (Required, Must be specified as the first argument of the method)
- content_name
- content_category
- value
- currency
reproio("trackAddToCart", "1234", {
value: 5000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing"
});
Add to wishlist¶
Tracks adding an item to wishlist
Usage
When a user taps "Add to Wishlist" button
Properties
- content_id
- content_name
- content_category
- value
- currency
reproio("trackAddToWishlist", {
value: 5000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing",
content_id: "1234"
});
Initiate Checkout¶
Tracks checkout process has started.
Usage
When a user taps "Checkout" button.
Properties
- content_id
- content_name
- content_category
- value
- currency
- num_items
reproio("trackInitiateCheckout", {
value: 8000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing",
content_id: "1234"
});
Add Payment Info¶
Tracks adding payment information.
Usage
When a user taps "Add payment info" button.
Properties
- content_id
- content_category
- value
- currency
reproio("trackAddPaymentInfo", {
value: 8000.0,
currency: "JPY",
content_category: "Clothing & Shoes > Mens > Clothing",
content_id: "1234"
});
Purchase¶
Track finalizing a purchase.
Usage
When a user taps "Complete Purchase" button.
Properties
content_id (Required, Must be specified as the first argument of the method)
value (Required, Must be specified as the second argument of the method)
currency (Required, Must be specified as the third argument of the method)
- content_name
- content_category
- num_items
reproio("trackPurchase", "1234", 8000.0, "JPY", {
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing",
num_items: 2
});
Share¶
Tracks sharing content to Social media (e.g. Facebook, Twitter).
Usage
When a user taps "Share" button.
Properties
- content_id
- content_name
- content_category
- service_name
reproio("trackShare", {
content_category: "Clothing & Shoes > Mens > Clothing",
content_name: "Slim Jeans",
content_id: "1234",
service_name: "twitter"
});
Lead¶
Tracks trial use of a feature. Use this method if your website doesn't require user login.
Usage
When a user taps "Try it" button
Properties
- content_name
- content_category
- value
- currency
reproio("trackLead", {
value: 8000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing"
});
Complete Registration¶
Tracks completing registration.
Usage
When a user taps "Signup" button
Properties
- content_name
- value
- currency
- status
reproio("trackCompleteRegistration", {
value: 8000.0,
currency: "JPY",
content_name: "Slim Jeans",
status: "completed"
});
Adding custom properties¶
You can also add custom properties to standard events. Set these custom properties within the extras
event property.
Note
If the key of the custom object property overlaps with a standard property event name, the value of the property will be ignored.
reproio("trackViewContent", "1234", {
value: 5000.0,
currency: "JPY",
content_name: "Slim Jeans",
content_category: "Clothing & Shoes > Mens > Clothing",
extras: {
color: "blue",
waist: 90
}
});
Custom Event¶
Track website-specific events other than standard events.
Note
Event name starting with
___repro___
is not allowed.null or empty string are not allowed for event names. Maximum length of event name is 191 characters.
// Custom event
reproio("track", "Finished tutorial");
// Custom event with properties
reproio("track", "user review", { rating: 3 });