{"_id":"5564cbf31fd04c0d00dc9a43","githubsync":"","user":"552d66b53e1c280d00f7641b","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"},"project":"552d67153e1c280d00f7641c","__v":11,"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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-26T19:39:31.665Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Conversion tracking is actually just an extension of event tracking.  A Perfect Audience \"in-app conversion\" is just a tracked event with extra metadata attached, associated with a conversion goal in your Perfect Audience dashboard.  \n\nWhen setting up tracking for an event that you want to count as a conversion, you may want to pass in extra meta data with the event.  You can do so using the method below.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[Marin trackEvent::::at:::\\\"Purchase\\\"\\n        withOrderId:@\\\"12345\\\"\\n            revenue:@\\\"19.99\\\"\\n conversionMetadata:nil\\n           metadata:nil];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nThe **orderId** should be an identifier unique to your system. This can be used for de-duplication.\n\n**Revenue** is a monetary value associated with the conversion. Currently the revenue value is currency agnostic.\n\n## Creating an In-app Conversion Goal in Perfect Audience\n \nOnce the event you want to count as a conversion has appeared in your account, you can create a conversion goal attached to it.\n\nNavigate to the **Create Conversion** page on your account.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/CWb2AYjRSkqiH5LhPyAz_6fwy986u.png\",\n        \"6fwy986u.png\",\n        \"283\",\n        \"451\",\n        \"#27669b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nFrom the **Create Conversion** page, select the event you want to associate to a conversion. Fill out the rest of the form and then click **Create Conversion Goal**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/LrQutWhmR8OcsDWBYbPS_gjld32rc.png\",\n        \"gjld32rc.png\",\n        \"642\",\n        \"444\",\n        \"#1c67a5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter the conversion creation all subsequent events that match the **Purchase** event will also be associated with the newly created conversion.\n\n<div style=\"display:none;\">\n\nThere are several additional fields supported by Marin that can be passed in the conversionMetaData param.\n\nNSDictionary *conversionMetadata = @{\n  @\"currency_code\": @\"\",\n  @\"order_id\": @\"\",\n  @\"order_type\": @\"\",\n  @\"product_id\": @[],\n  @\"product_category\": @[],\n  @\"product_quantity\": @[],\n  @\"product_unit_price\": @[],\n  @\"marin_convType\": @[],\n  @\"marin_order_id\": @[]\n};\n [Marin trackEvent:@\"Purchase\"\n       withOrderId:@\"12345\"\n           revenue:@\"12.99\"\nconversionMetadata:conversionMetadata\n          metadata:nil];\n\n</div>","excerpt":"","slug":"tracking-conversions","type":"basic","title":"Tracking Conversions"}

Tracking Conversions


Conversion tracking is actually just an extension of event tracking. A Perfect Audience "in-app conversion" is just a tracked event with extra metadata attached, associated with a conversion goal in your Perfect Audience dashboard. When setting up tracking for an event that you want to count as a conversion, you may want to pass in extra meta data with the event. You can do so using the method below. [block:code] { "codes": [ { "code": "[Marin trackEvent:@\"Purchase\"\n withOrderId:@\"12345\"\n revenue:@\"19.99\"\n conversionMetadata:nil\n metadata:nil];", "language": "objectivec" } ] } [/block] The **orderId** should be an identifier unique to your system. This can be used for de-duplication. **Revenue** is a monetary value associated with the conversion. Currently the revenue value is currency agnostic. ## Creating an In-app Conversion Goal in Perfect Audience Once the event you want to count as a conversion has appeared in your account, you can create a conversion goal attached to it. Navigate to the **Create Conversion** page on your account. [block:image] { "images": [ { "image": [ "https://files.readme.io/CWb2AYjRSkqiH5LhPyAz_6fwy986u.png", "6fwy986u.png", "283", "451", "#27669b", "" ] } ] } [/block] From the **Create Conversion** page, select the event you want to associate to a conversion. Fill out the rest of the form and then click **Create Conversion Goal**. [block:image] { "images": [ { "image": [ "https://files.readme.io/LrQutWhmR8OcsDWBYbPS_gjld32rc.png", "gjld32rc.png", "642", "444", "#1c67a5", "" ] } ] } [/block] After the conversion creation all subsequent events that match the **Purchase** event will also be associated with the newly created conversion. <div style="display:none;"> There are several additional fields supported by Marin that can be passed in the conversionMetaData param. NSDictionary *conversionMetadata = @{ @"currency_code": @"", @"order_id": @"", @"order_type": @"", @"product_id": @[], @"product_category": @[], @"product_quantity": @[], @"product_unit_price": @[], @"marin_convType": @[], @"marin_order_id": @[] }; [Marin trackEvent:@"Purchase" withOrderId:@"12345" revenue:@"12.99" conversionMetadata:conversionMetadata metadata:nil]; </div>