{"_id":"588861fa165af631008ee1d4","user":"54861b9f3681d914006992a4","parentDoc":null,"project":"54861bb654b3ce0b00367292","category":{"_id":"588861fa165af631008ee1ba","__v":0,"version":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-08T21:55:25.679Z","from_sync":false,"order":1,"slug":"1-setup","title":"iOS / App Triggers"},"version":{"_id":"588861fa165af631008ee1b8","__v":1,"project":"54861bb654b3ce0b00367292","createdAt":"2017-01-25T08:29:46.061Z","releaseDate":"2017-01-25T08:29:46.061Z","categories":["588861fa165af631008ee1b9","588861fa165af631008ee1ba","588861fa165af631008ee1bb","588861fa165af631008ee1bc","588861fa165af631008ee1bd","588861fa165af631008ee1be","588861fa165af631008ee1bf","588861fa165af631008ee1c0","588861fa165af631008ee1c1","588861fa165af631008ee1c2","588861fa165af631008ee1c3","588861fa165af631008ee1c4","588861fa165af631008ee1c5","588861fa165af631008ee1c6","588861fa165af631008ee1c7","588861fa165af631008ee1c8","588861fa165af631008ee1c9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.0.0","version":"5.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-08T14:54:46.938Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"You can share information to drive deeper personalization capabilities, user data, user behavior and source attribution\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Prior to starting the initial session:\"\n}\n[/block]\nIn order to apply these configurations, change the following code in your app delegate as following: \n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"- (BOOL)application:(UIApplication *)application \\n didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\\n // Override point for customization after application launch.\\n \\n // basic setup\\n [ElastiCode setAPIKey::::at:::\\\"<APIKey>\\\"]; \\n \\n // app triggers basic setup \\n\\tECSessionParams* params = [ECSessionParams createInProduction:NO];\\n\\n // apply configurations...\\n \\n [ElastiCode setSessionParams:params];\\n\\t[ElastiCode ready];\\n return YES;\\n}\",\n \"language\": \"objectivec\"\n },\n {\n \"code\": \"class AppDelegate: UIResponder, UIApplicationDelegate {\\nvar window: UIWindow?\\n\\nfunc application(application: UIApplication, didFinishLaunchingWithOptions\\n launchOptions: [NSObject: AnyObject]?) -> Bool {\\n // Override point for customization after application launch.\\n \\n // basic setup\\n \\tElastiCode.setAPIKey(\\\"<APIKey>\\\")\\n \\n // app triggers basic setup\\n\\t\\tlet params:ECSessionParams = ECSessionParams .createInProduction(false)\\n\\n\\t\\t// apply configurations... \\n \\n ElastiCode.setSessionParams(params)\\n ElastiCode.ready()\\n return true\\n}\",\n \"language\": \"swift\"\n }\n ]\n}\n[/block]\n\n\n1.Key value attribution (bool , int , double , string)\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"[params.data addSessionAttributes:(NSDictionary*)];\",\n \"language\": \"objectivec\"\n },\n {\n \"code\": \"params.data .addSessionAttributes([NSObject : AnyObject])\",\n \"language\": \"swift\"\n }\n ]\n}\n[/block]\n2. [Source Attribution](doc:source-attr) \n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"[params.data addSessionAppsFlyerAttributes:(NSDictionary*)];\\n\\n[params.data addSessionBranchIOAttributes:(NSDictionary*)];\\n\\n[params.data addSessionButtonAttributes:(NSDictionary*)];\\n\\n[params.data addSessionAdjustAttributes:(NSDictionary*)];\\n\\n[params.data addSessionKochavaAttributes:(NSDictionary*)];\",\n \"language\": \"objectivec\"\n },\n {\n \"code\": \"params.data .addSessionAppsFlyerAttributes([NSObject : AnyObject])\\n\\nparams.data .addSessionBranchIOAttributes([NSObject : AnyObject])\\n\\nparams.data .addSessionButtonAttributes([NSObject : AnyObject])\\n\\nparams.data .addSessionAdjustAttributes([NSObject : AnyObject])\\n\\nparams.data .addSessionKochavaAttributes([NSObject : AnyObject])\",\n \"language\": \"swift\"\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Post initial session setup\"\n}\n[/block]\nIn addition, there are three relevant fixed types of information, or any key-value parameter.\n\nFor example: Males, between 20-25, US residents, using iOS7, who downloaded 3 social apps and have entered your app 4 times this week - will receive alternative A.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Key (String)\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description/Example\",\n \"0-0\": \"Age\",\n \"0-1\": \"Double\",\n \"0-2\": \"20, 30.5, 40.05, etc...\",\n \"1-0\": \"Gender\",\n \"1-1\": \"Int\",\n \"1-2\": \"0 - Male, 1 - Female\",\n \"2-0\": \"Location\",\n \"2-1\": \"String\",\n \"2-2\": \"The coordinates formated as string (Left - Lat, Right - Lon): (37.70042180136,-81.84539998)\",\n \"3-0\": \"[Your Key]\",\n \"3-1\": \"bool \\nint \\ndouble \\nstring\",\n \"3-2\": \"Your own key - value\"\n },\n \"cols\": 3,\n \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Share your own parameters!\",\n \"body\": \"You can add your own keys, but they should receive only Boolean, Integer, Double and String values.\"\n}\n[/block]\nUse the following methods to share the relevant user info:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"[ElastiCode shareUserInfo:@{\\n @\\\"Age\\\" : @(20.5),\\n @\\\"Gender\\\" : @0,\\n @\\\"Location\\\" : @\\\"(37.700421688980136,-81.84535319999998)\\\"\\n}];\",\n \"language\": \"objectivec\",\n \"name\": \"Objective-C\"\n },\n {\n \"code\": \"var userInfo: [String: AnyObject] = [\\n \\\"Age\\\" : 20,\\n\\t\\\"Gender\\\" : 0,\\n\\t\\\"Location\\\" : \\\"(37.700421688980136,-81.84535319999998)\\\"\\n]\\nElastiCode .shareUserInfo(userInfo)\",\n \"language\": \"objectivec\",\n \"name\": \"Swift\"\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Adding events [post initial session setup]\"\n}\n[/block]\nYou can use the *event *method to share about user behaviors:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \" [ElastiCode event:@\\\"finished registration flow\\\"];\",\n \"language\": \"objectivec\",\n \"name\": \"Objective-C\"\n },\n {\n \"code\": \"ElastiCode .event(\\\"finished registration flow\\\") \",\n \"language\": \"text\",\n \"name\": \"Swift\"\n }\n ]\n}\n[/block]\nYou can also add parameters to that event:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"[ElastiCode event:@\\\"finished registration flow\\\"\\n attributes:@{\\n @\\\"timePassed\\\" : @(30)\\n }];\",\n \"language\": \"objectivec\",\n \"name\": \"Objective-C\"\n },\n {\n \"code\": \"var attributes: [String: AnyObject] = [\\\"timePassed\\\" : 30]\\nElastiCode .event(\\\"finished registration flow\\\", attributes: attributes) \",\n \"language\": \"objectivec\",\n \"name\": \"Swift\"\n }\n ]\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"info\",\n \"body\": \"You can add your own keys, but they should receive only Boolean, Integer, Double and String values.\",\n \"title\": \"Share your own parameters!\"\n}\n[/block]","excerpt":"IOS / APP TRIGGERS: User infomration","slug":"sharing-information","type":"basic","title":"User infomration"}
User infomration
IOS / APP TRIGGERS: User infomration