{"__v":17,"_id":"562014118a05d7230006ffd5","category":{"__v":18,"_id":"562014108a05d7230006ffad","pages":["562014118a05d7230006ffb6","562014118a05d7230006ffb7","562014118a05d7230006ffb8","562014118a05d7230006ffb9","562014118a05d7230006ffba","562014118a05d7230006ffbb","562014118a05d7230006ffbc","562014118a05d7230006ffbd","562014118a05d7230006ffbe","562014118a05d7230006ffbf","562014118a05d7230006ffc0","5620146f8a05d72300070013","565ed96ff76b8d0d0055422b","565f1bb623fd5f0d00a12a51","565f2996413e06170093de98","565f29db0dc99e1900f24ba8","565f2b23649b951900c89724","565f2b5d413e06170093de9e","5666d8b46819320d000c2e10","5666dd1866debc1700503e38","5666e3da5d00370d00ede577","5666ef36f672550d000851aa","5666f1116819320d000c2e3e","5666f7bf6819320d000c2e53","5672d7fe3cab740d00d15a48","56e961cef3c3031900041af4","56ebc03943304e2900e2116f","56f116a0ab5e790e00fb3950"],"project":"54861bb654b3ce0b00367292","version":"5620140f8a05d7230006ffac","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-08T21:55:25.679Z","from_sync":false,"order":0,"slug":"1-setup","title":"Onboarding/Moment integration"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","version":{"__v":3,"_id":"5620140f8a05d7230006ffac","project":"54861bb654b3ce0b00367292","createdAt":"2015-10-15T21:01:03.908Z","releaseDate":"2015-10-15T21:01:03.908Z","categories":["562014108a05d7230006ffad","562014108a05d7230006ffae","562014108a05d7230006ffaf","562014108a05d7230006ffb0","562014108a05d7230006ffb1","562014108a05d7230006ffb2","562014108a05d7230006ffb3","562014108a05d7230006ffb4","562014108a05d7230006ffb5","5666f7f5d784a70d00397bff","56967935b6d61f0d00acfb0b"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"Moments","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-04T06:16:32.974Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/tdcKFmgoTwmkNLcFXbH2_logo.png\",\n        \"logo.png\",\n        \"194\",\n        \"57\",\n        \"#0493cc\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can easily pass your **appsFlyer** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived.\n\n\nYou can create this helper method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void) startElasticodeWithAppsFlyerInstallData:(NSDictionary*) installData{\\n  if(installData){\\n  \\t[ElastiCode addSessionAppsFlyerAttributes:installData];\\n  }\\n  [ElastiCode startSession::::at:::\\\"your-api-key\\\" onBoardingVersion:@\\\"1.0\\\"];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func startElasticodeWithAppsFlyerInstallData(installData: [NSObject : AnyObject]?) {\\n\\tif let p = installData {\\n  \\tElastiCode .addSessionAppsFlyerAttributes(p)\\n  }\\n  ElastiCode .startSession(\\\"your-api-key\\\", onBoardingVersion: \\\"1.0\\\")\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nAnd just add the AppsFlyer methods to your appDelegate:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void)onConversionDataReceived:(NSDictionary*) installData {\\n\\t[self startElasticodeWithAppsFlyerInstallData: installData];\\n}\\n\\n-(void)onConversionDataRequestFailure:(NSError *) error {\\n\\t[self startElasticodeWithAppsFlyerInstallData: nil];\\n}\\n\\n\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func onConversionDataReceived(installData: [NSObject : AnyObject]?) {\\n\\tstartElasticodeWithAppsFlyerInstallData(installData)\\n}\\n\\nfunc onConversionDataRequestFailure(error: NSError) {\\n\\tstartElasticodeWithAppsFlyerInstallData(nil)\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nMore AppsFlyer documentation can be found [here](https://support.appsflyer.com/entries/69796693-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deep-linking-).\n\n\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/8H5R9vbVQtOQ2rGUG4pu_br.png\",\n        \"br.png\",\n        \"194\",\n        \"57\",\n        \"#5392ab\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can easily pass your **branch.io** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived.\n\n\nYou can create this helper method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void) startElasticodeWithBranchIOParams:(NSDictionary*) params{\\n  if(params){\\n  \\t[ElastiCode addSessionBranchIOAttributes:params];\\n  }\\n  [ElastiCode startSession:@\\\"your-api-key\\\" onBoardingVersion:@\\\"1.0\\\"];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func startElasticodeWithBranchIOParams(params: [NSObject : AnyObject]?) {\\n\\tif let p = params {\\n  \\tElastiCode .addSessionBranchIOAttributes(p)\\n  }\\n  ElastiCode .startSession(\\\"your-api-key\\\", onBoardingVersion: \\\"1.0\\\")\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nAnd just add the branch.io methods to your appDelegate, didFinishLaunchingWithOptions method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[[Branch getInstance] initSessionWithLaunchOptions:launchOptions \\n \\t\\t\\t    andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {\\n  if (!error) {\\n    [self startElasticodeWithBranchIOParams:params];\\n  }else{\\n    [self startElasticodeWithBranchIOParams:nil];\\n  }\\n}];\\n\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"let branch: Branch = Branch.getInstance()\\n    branch.initSessionWithLaunchOptions(launchOptions, true, andRegisterDeepLinkHandler: { params, error in\\n        if (params) {\\n\\t\\t\\t\\t\\tstartElasticodeWithBranchIOParams(params)\\n        } else {\\n\\t\\t\\t\\t\\tstartElasticodeWithBranchIOParams(nil)\\n        }\\n    })\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nMore Branch.io documentation can be found [here](https://dev.branch.io/).\n\n\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/q2P2HDt2Qoe9mG5FRfU7_button.png\",\n        \"button.png\",\n        \"194\",\n        \"57\",\n        \"#60a1d9\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can easily pass your **button** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived.\n\n\nYou can create this helper method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void) startElasticodeWithButtonParams:(NSDictionary*) params{\\n  if(params){\\n  \\t[ElastiCode addSessionButtonAttributes:params];\\n  }\\n  [ElastiCode startSession:@\\\"your-api-key\\\" onBoardingVersion:@\\\"1.0\\\"];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func startElasticodeWithButtonParams(params: [NSObject : AnyObject]?) {\\n\\tif let p = params {\\n  \\tElastiCode .addSessionButtonAttributes(p)\\n  }\\n  ElastiCode .startSession(\\\"your-api-key\\\", onBoardingVersion: \\\"1.0\\\")\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nWhen you register to the route handler pass the parameters to elasticode and start the session:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// For example:\\nself.router[@\\\"/log/:message\\\"] = ^(DPLDeepLink *link) {\\n  [self startElasticodeWithButtonParams:link.routeParameters];\\n};\\n\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"// For example:\\npublic class DPLMessageRouteHandler: DPLRouteHandler {\\n    public override func shouldHandleDeepLink(deepLink: DPLDeepLink!) -> Bool {\\n    \\tif let deepLinkParams = deepLink.routeParameters {\\n      \\tstartElasticodeWithButtonParams(deepLinkParams)\\n      }\\n      return false\\n    }\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nMore Button documentation can be found [here](https://www.usebutton.com/developers/deep-links/).\n\n\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Yx906zXITWgqD1OM6wTA_logo-adjust@2x.png\",\n        \"logo-adjust@2x.png\",\n        \"342\",\n        \"112\",\n        \"#1cbcd4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void) startElasticodeWithAdjustParams:(NSDictionary*) params{\\n  if(params){\\n  \\t[ElastiCode addSessionAdjustAttributes:params];\\n  }\\n  [ElastiCode startSession:@\\\"your-api-key\\\" onBoardingVersion:@\\\"1.0\\\"];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func startElasticodeWithAdjustParams(params: [NSObject : AnyObject]?) {\\n\\tif let p = params {\\n  \\tElastiCode .addSessionAdjustAttributes(p)\\n  }\\n  ElastiCode .startSession(\\\"your-api-key\\\", onBoardingVersion: \\\"1.0\\\")\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nIn the delegate callback implementation pass the parameters to elasticode and start the session:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// For example:  \\n  - (void)adjustAttributionChanged:(ADJAttribution *)attribution {\\n  [self startElasticodeWithAdjustParams:[attribuition dictionary]];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func adjustAttributionChanged(attribution: ADJAttribution) {\\n\\tstartElasticodeWithAdjustParams(attribution.dictionary())\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nMore Adjust documentation can be found [here](https://github.com/adjust/ios_sdk#9-implement-the-attribution-callback).","excerpt":"","slug":"source-attr","type":"basic","title":"Source Attribution"}

Source Attribution


[block:image] { "images": [ { "image": [ "https://files.readme.io/tdcKFmgoTwmkNLcFXbH2_logo.png", "logo.png", "194", "57", "#0493cc", "" ] } ] } [/block] You can easily pass your **appsFlyer** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived. You can create this helper method: [block:code] { "codes": [ { "code": "-(void) startElasticodeWithAppsFlyerInstallData:(NSDictionary*) installData{\n if(installData){\n \t[ElastiCode addSessionAppsFlyerAttributes:installData];\n }\n [ElastiCode startSession:@\"your-api-key\" onBoardingVersion:@\"1.0\"];\n}", "language": "objectivec" }, { "code": "func startElasticodeWithAppsFlyerInstallData(installData: [NSObject : AnyObject]?) {\n\tif let p = installData {\n \tElastiCode .addSessionAppsFlyerAttributes(p)\n }\n ElastiCode .startSession(\"your-api-key\", onBoardingVersion: \"1.0\")\n}", "language": "swift" } ] } [/block] And just add the AppsFlyer methods to your appDelegate: [block:code] { "codes": [ { "code": "-(void)onConversionDataReceived:(NSDictionary*) installData {\n\t[self startElasticodeWithAppsFlyerInstallData: installData];\n}\n\n-(void)onConversionDataRequestFailure:(NSError *) error {\n\t[self startElasticodeWithAppsFlyerInstallData: nil];\n}\n\n", "language": "objectivec" }, { "code": "func onConversionDataReceived(installData: [NSObject : AnyObject]?) {\n\tstartElasticodeWithAppsFlyerInstallData(installData)\n}\n\nfunc onConversionDataRequestFailure(error: NSError) {\n\tstartElasticodeWithAppsFlyerInstallData(nil)\n}", "language": "swift" } ] } [/block] More AppsFlyer documentation can be found [here](https://support.appsflyer.com/entries/69796693-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deep-linking-). [block:api-header] { "type": "basic" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/8H5R9vbVQtOQ2rGUG4pu_br.png", "br.png", "194", "57", "#5392ab", "" ] } ] } [/block] You can easily pass your **branch.io** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived. You can create this helper method: [block:code] { "codes": [ { "code": "-(void) startElasticodeWithBranchIOParams:(NSDictionary*) params{\n if(params){\n \t[ElastiCode addSessionBranchIOAttributes:params];\n }\n [ElastiCode startSession:@\"your-api-key\" onBoardingVersion:@\"1.0\"];\n}", "language": "objectivec" }, { "code": "func startElasticodeWithBranchIOParams(params: [NSObject : AnyObject]?) {\n\tif let p = params {\n \tElastiCode .addSessionBranchIOAttributes(p)\n }\n ElastiCode .startSession(\"your-api-key\", onBoardingVersion: \"1.0\")\n}", "language": "swift" } ] } [/block] And just add the branch.io methods to your appDelegate, didFinishLaunchingWithOptions method: [block:code] { "codes": [ { "code": "[[Branch getInstance] initSessionWithLaunchOptions:launchOptions \n \t\t\t andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {\n if (!error) {\n [self startElasticodeWithBranchIOParams:params];\n }else{\n [self startElasticodeWithBranchIOParams:nil];\n }\n}];\n", "language": "objectivec" }, { "code": "let branch: Branch = Branch.getInstance()\n branch.initSessionWithLaunchOptions(launchOptions, true, andRegisterDeepLinkHandler: { params, error in\n if (params) {\n\t\t\t\t\tstartElasticodeWithBranchIOParams(params)\n } else {\n\t\t\t\t\tstartElasticodeWithBranchIOParams(nil)\n }\n })", "language": "swift" } ] } [/block] More Branch.io documentation can be found [here](https://dev.branch.io/). [block:api-header] { "type": "basic" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/q2P2HDt2Qoe9mG5FRfU7_button.png", "button.png", "194", "57", "#60a1d9", "" ] } ] } [/block] You can easily pass your **button** information to elasticode, to personalized the on boarding experience, with information form the campaign the user arrived. You can create this helper method: [block:code] { "codes": [ { "code": "-(void) startElasticodeWithButtonParams:(NSDictionary*) params{\n if(params){\n \t[ElastiCode addSessionButtonAttributes:params];\n }\n [ElastiCode startSession:@\"your-api-key\" onBoardingVersion:@\"1.0\"];\n}", "language": "objectivec" }, { "code": "func startElasticodeWithButtonParams(params: [NSObject : AnyObject]?) {\n\tif let p = params {\n \tElastiCode .addSessionButtonAttributes(p)\n }\n ElastiCode .startSession(\"your-api-key\", onBoardingVersion: \"1.0\")\n}", "language": "swift" } ] } [/block] When you register to the route handler pass the parameters to elasticode and start the session: [block:code] { "codes": [ { "code": "// For example:\nself.router[@\"/log/:message\"] = ^(DPLDeepLink *link) {\n [self startElasticodeWithButtonParams:link.routeParameters];\n};\n", "language": "objectivec" }, { "code": "// For example:\npublic class DPLMessageRouteHandler: DPLRouteHandler {\n public override func shouldHandleDeepLink(deepLink: DPLDeepLink!) -> Bool {\n \tif let deepLinkParams = deepLink.routeParameters {\n \tstartElasticodeWithButtonParams(deepLinkParams)\n }\n return false\n }\n}", "language": "swift" } ] } [/block] More Button documentation can be found [here](https://www.usebutton.com/developers/deep-links/). [block:image] { "images": [ { "image": [ "https://files.readme.io/Yx906zXITWgqD1OM6wTA_logo-adjust@2x.png", "logo-adjust@2x.png", "342", "112", "#1cbcd4", "" ] } ] } [/block] [block:code] { "codes": [ { "code": "-(void) startElasticodeWithAdjustParams:(NSDictionary*) params{\n if(params){\n \t[ElastiCode addSessionAdjustAttributes:params];\n }\n [ElastiCode startSession:@\"your-api-key\" onBoardingVersion:@\"1.0\"];\n}", "language": "objectivec" }, { "code": "func startElasticodeWithAdjustParams(params: [NSObject : AnyObject]?) {\n\tif let p = params {\n \tElastiCode .addSessionAdjustAttributes(p)\n }\n ElastiCode .startSession(\"your-api-key\", onBoardingVersion: \"1.0\")\n}", "language": "swift" } ] } [/block] In the delegate callback implementation pass the parameters to elasticode and start the session: [block:code] { "codes": [ { "code": "// For example: \n - (void)adjustAttributionChanged:(ADJAttribution *)attribution {\n [self startElasticodeWithAdjustParams:[attribuition dictionary]];\n}", "language": "objectivec" }, { "code": "func adjustAttributionChanged(attribution: ADJAttribution) {\n\tstartElasticodeWithAdjustParams(attribution.dictionary())\n}", "language": "swift" } ] } [/block] More Adjust documentation can be found [here](https://github.com/adjust/ios_sdk#9-implement-the-attribution-callback).