{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Tracking Conversions","type":"basic","slug":"tracking-conversions","excerpt":"","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>","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5564cbf31fd04c0d00dc9a43","githubsync":"","user":"552d66b53e1c280d00f7641b","createdAt":"2015-05-26T19:39:31.665Z","category":{"sync":{"isSync":false,"url":""},"pages":["5564cba6f0f70f0d00a9aadb","5564cbb11fd04c0d00dc9a41","5564cbf31fd04c0d00dc9a43","55b0034ad7624e3700e4fb94","55b031e8f202b12100cda16b"],"title":"Marin iOS SDK","slug":"marin-ios-sdk","order":9999,"from_sync":false,"reference":false,"_id":"5564cb5c1fd04c0d00dc9a40","project":"552d67153e1c280d00f7641c","version":"552d67153e1c280d00f7641f","__v":5,"createdAt":"2015-05-26T19:37:00.006Z"},"project":"552d67153e1c280d00f7641c","__v":11,"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["552d67163e1c280d00f76420","5564cb5c1fd04c0d00dc9a40","5568ec5ec87afd2500e52598"],"_id":"552d67153e1c280d00f7641f","project":"552d67153e1c280d00f7641c","releaseDate":"2015-04-14T19:14:29.744Z","__v":3,"createdAt":"2015-04-14T19:14:29.744Z"}}