{"_id":"5564cba6f0f70f0d00a9aadb","__v":14,"githubsync":"","project":"552d67153e1c280d00f7641c","user":"552d66b53e1c280d00f7641b","version":{"_id":"552d67153e1c280d00f7641f","project":"552d67153e1c280d00f7641c","__v":3,"createdAt":"2015-04-14T19:14:29.744Z","releaseDate":"2015-04-14T19:14:29.744Z","categories":["552d67163e1c280d00f76420","5564cb5c1fd04c0d00dc9a40","5568ec5ec87afd2500e52598"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5564cb5c1fd04c0d00dc9a40","pages":["5564cba6f0f70f0d00a9aadb","5564cbb11fd04c0d00dc9a41","5564cbf31fd04c0d00dc9a43","55b0034ad7624e3700e4fb94","55b031e8f202b12100cda16b"],"project":"552d67153e1c280d00f7641c","version":"552d67153e1c280d00f7641f","__v":5,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-26T19:37:00.006Z","from_sync":false,"order":9999,"slug":"marin-ios-sdk","title":"Marin iOS SDK"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-26T19:38:14.311Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"","language":"text"}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Event tracking is the backbone for creating audiences with the Marin iOS SDK. Events are used to segment (group) similar devices based on custom triggers.\n\nTo track custom events, use the following API after having initialized the SDK.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[Marin trackEvent::::at:::\\\"event1\\\" withMetadata:nil];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Event Naming\",\n  \"body\": \"Events can be named anything. But note that there is one internal event created for all apps named `devices.all_opens`. This name should be avoided for any additional events.\"\n}\n[/block]\n<div style=\"display:none;\">\n\nSome customers may have extra data that they would like to be associated with their event. Such metadata can be associated by passing a dictionary to the metadata field like so.\n\nNSDictionary *data = @{\n  @\"game_id\": @\"123ABC\",\n  @\"participants\": [\n    @\"user 1\",\n    @\"user 2\"\n  ]\n};\n[Marin trackEvent:@\"event1\" withMetadata:data];\n\nThis data will be stored as an object along with other event attributes.\n\n</div>","excerpt":"","slug":"tracking-events","type":"basic","title":"Tracking Events"}
Event tracking is the backbone for creating audiences with the Marin iOS SDK. Events are used to segment (group) similar devices based on custom triggers. To track custom events, use the following API after having initialized the SDK. [block:code] { "codes": [ { "code": "[Marin trackEvent:@\"event1\" withMetadata:nil];", "language": "objectivec" } ] } [/block] [block:callout] { "type": "warning", "title": "Event Naming", "body": "Events can be named anything. But note that there is one internal event created for all apps named `devices.all_opens`. This name should be avoided for any additional events." } [/block] <div style="display:none;"> Some customers may have extra data that they would like to be associated with their event. Such metadata can be associated by passing a dictionary to the metadata field like so. NSDictionary *data = @{ @"game_id": @"123ABC", @"participants": [ @"user 1", @"user 2" ] }; [Marin trackEvent:@"event1" withMetadata:data]; This data will be stored as an object along with other event attributes. </div>