Events are tracked in RSKit by calling the track:: method at the relevant location in your code. You can track events like registration, view, view item, adding to cart, checkout success, etc.
Please note that when your event parameters involve items you should define an array to hold individual items. When you add this item array to the main properties, keep the key as `items`. RSClient expects the above format whenever you are transmitting a List/array of items. The parent key should be `items` and its value should be Array. If you are tracking events like `category_view` keep the key as `items`.
- Tracking registration events
- Tracking view events
- Tracking view item events
- Tracking click events
- Tracking category view events
- Tracking add to cart events
- Tracking checkout success events
- Tracking deep-linked email_click events
Tracking registration events
Define the registration parameters, give the event name as `registration_complete` and call the "track" method.
Objective-C:
[[RSClient sharedClient] track:@"registration_complete" properties:@{@"registration_source": @"google ads"}];
Tracking view events
Define the view event parameters, give the event name as `view` and call the "track" method.
Objective-C:
[[RSClient sharedClient] track:@"view" properties:@{@"page_title": @"All Products"}];
Tracking view item events
Define the view item event parameters, give the event name as `view` and call the "track" method.
Objective-C:
[[RSClient sharedClient] track:@"view" properties:@{@"page_title": @"bikes page", @"items": @[@{@"id": @"BIKE123", @"name": @"BIKE", @"price": @"399.99"}]}];
Tracking click events
Define the click event parameters, give the event name as `click` and call the "track" method.
Objective-C:
[[RSClient sharedClient] track:@"click" properties:@{@"clicked_href": @"/items/name-of-item"}];
Tracking category view events
Define the category view event parameters, give the event name as `category_view` and call the track method.
Objective-C:
[[RSClient sharedClient] track:@"category_view" properties:@{@"items": @[@{@"id": @"123", @"name": @"category name"}]}];
Tracking add to cart events
Define the shopping cart event parameters, give the event name as `shopping_cart` and call the track method.
Objective-C:
[[RSClient sharedClient] track:@"shopping_cart" properties:@{@"items": @[@{@"id": @"123", @"name": @"Bike helmet", @"price": @"50.0"}]}];
Tracking checkout success events
Define the checkout success event parameters, give the event name as `checkout_success` and call the "track" method.
Objective-C:
[[RSClient sharedClient] track:@"checkout_success" properties:@{@"order_id": @"12345678910", @"order_total": @"150.00", @"items": @[@{@"id": @"BIKE123", @"name": @"BIKE", @"price": @"399.99"}, @{@"id": @"tail123", @"name": @"tail light", @"price": @"99.99"}]}];
Tracking deep-linked email_click events
If you are using deep-links and a user has clicked through from an email you can track the email_click action by extracting the rs_oid GET parameter from the deep-link URL. This "track" method should be as follows:
Set the event name as `email_click`, pass the rs_oid parameter as `offer_id`, and call the "track" method.
Objective-C:
// Extract the GET param rs_oid from the deep-linked URL
// eg. http://example.com/deep-link?rs_oid=12345678910
NSNumber *offerId = @12345678910L;
[[RSClient sharedClient] track:@"email_click" properties:@{@"offer_id": offerId}];
Comments
0 comments
Please sign in to leave a comment.