{"__v":14,"_id":"5666ef36f672550d000851aa","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":"54861b9f3681d914006992a4","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-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":2,"body":"You can share information that would allow you to drive deeper personalization capabilities, user data, behaviours and source attribution\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Prior to starting the initial session:\"\n}\n[/block]\nIn order for this information to affect the onboarding experience you should share this information **before** you initiate the session\n\n1.Key value attribution (bool , int , double  , string)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"+(void)addSessionAttributes:(NSDictionary*)attributes;\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func addSessionAttributes(attributes: [NSObject : AnyObject])\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n2. Source attribution\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"+(void)addSessionAppsFlyerAttributes:(NSDictionary*)attributes;\\n\\n+(void)addSessionBranchIOAttributes:(NSDictionary*)attributes;\\n\\n+(void)addSessionButtonAttributes:(NSDictionary*)attributes;\\n\\n+(void)addSessionAdjustAttributes:(NSDictionary*)attributes;\\n\\n+(void)addSessionKochavaAttributes:(NSDictionary*)attributes;\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func addSessionAppsFlyerAttributes(attributes: [NSObject : AnyObject])\\n\\nfunc addSessionBranchIOAttributes(attributes: [NSObject : AnyObject])\\n\\nfunc addSessionButtonAttributes(attributes: [NSObject : AnyObject])\\n\\nfunc addSessionAdjustAttributes(attributes: [NSObject : AnyObject])\\n\\nfunc addSessionKochavaAttributes(attributes: [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]\n\nIn addition, there are three fixed types of information that are relevant, or any key-value parameter.\n\nFor example: Males, between 20-25, from the US, who has iOS7, downloaded 3 social apps on their device and 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\": \"Adding your own keys are possible, but they should receive only BOOL, Int, Double and String values.\"\n}\n[/block]\nharing with the elasticode cloud the relevant user info is VIA the shareUserInfo method :\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[ElastiCode shareUserInfo::::at:::{\\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 the user behavioure:\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\": \"Adding your own keys are possible, but they should receive only Boolean, Int, Double and String values.\",\n  \"title\": \"Share your own parameters!\"\n}\n[/block]","excerpt":"User information​ and source attribution","slug":"sharing-information","type":"basic","title":"Sharing information (Personalization Triggers)"}

Sharing information (Personalization Triggers)

User information​ and source attribution

You can share information that would allow you to drive deeper personalization capabilities, user data, behaviours and source attribution [block:api-header] { "type": "basic", "title": "Prior to starting the initial session:" } [/block] In order for this information to affect the onboarding experience you should share this information **before** you initiate the session 1.Key value attribution (bool , int , double , string) [block:code] { "codes": [ { "code": "+(void)addSessionAttributes:(NSDictionary*)attributes;", "language": "objectivec" }, { "code": "func addSessionAttributes(attributes: [NSObject : AnyObject])", "language": "swift" } ] } [/block] 2. Source attribution [block:code] { "codes": [ { "code": "+(void)addSessionAppsFlyerAttributes:(NSDictionary*)attributes;\n\n+(void)addSessionBranchIOAttributes:(NSDictionary*)attributes;\n\n+(void)addSessionButtonAttributes:(NSDictionary*)attributes;\n\n+(void)addSessionAdjustAttributes:(NSDictionary*)attributes;\n\n+(void)addSessionKochavaAttributes:(NSDictionary*)attributes;", "language": "objectivec" }, { "code": "func addSessionAppsFlyerAttributes(attributes: [NSObject : AnyObject])\n\nfunc addSessionBranchIOAttributes(attributes: [NSObject : AnyObject])\n\nfunc addSessionButtonAttributes(attributes: [NSObject : AnyObject])\n\nfunc addSessionAdjustAttributes(attributes: [NSObject : AnyObject])\n\nfunc addSessionKochavaAttributes(attributes: [NSObject : AnyObject])", "language": "swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Post initial session setup" } [/block] In addition, there are three fixed types of information that are relevant, or any key-value parameter. For example: Males, between 20-25, from the US, who has iOS7, downloaded 3 social apps on their device and entered your app 4 times this week - will receive alternative A. [block:parameters] { "data": { "h-0": "Key (String)", "h-1": "Type", "h-2": "Description/Example", "0-0": "Age", "0-1": "Double", "0-2": "20, 30.5, 40.05, etc...", "1-0": "Gender", "1-1": "Int", "1-2": "0 - Male, 1 - Female", "2-0": "Location", "2-1": "String", "2-2": "The coordinates formated as string (Left - Lat, Right - Lon): (37.70042180136,-81.84539998)", "3-0": "[Your Key]", "3-1": "bool \nint \ndouble \nstring", "3-2": "Your own key - value" }, "cols": 3, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Share your own parameters!", "body": "Adding your own keys are possible, but they should receive only BOOL, Int, Double and String values." } [/block] haring with the elasticode cloud the relevant user info is VIA the shareUserInfo method : [block:code] { "codes": [ { "code": "[ElastiCode shareUserInfo:@{\n @\"Age\" : @(20.5),\n @\"Gender\" : @0,\n @\"Location\" : @\"(37.700421688980136,-81.84535319999998)\"\n}];", "language": "objectivec", "name": "Objective-C" }, { "code": "var userInfo: [String: AnyObject] = [\n \"Age\" : 20,\n\t\"Gender\" : 0,\n\t\"Location\" : \"(37.700421688980136,-81.84535319999998)\"\n]\nElastiCode .shareUserInfo(userInfo)", "language": "objectivec", "name": "Swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Adding events [post initial session setup]" } [/block] You can use the *event *method to share about the user behavioure: [block:code] { "codes": [ { "code": " [ElastiCode event:@\"finished registration flow\"];", "language": "objectivec", "name": "Objective-C" }, { "code": "ElastiCode .event(\"finished registration flow\") ", "language": "text", "name": "Swift" } ] } [/block] You can also add parameters to that event: [block:code] { "codes": [ { "code": "[ElastiCode event:@\"finished registration flow\"\n attributes:@{\n @\"timePassed\" : @(30)\n }];", "language": "objectivec", "name": "Objective-C" }, { "code": "var attributes: [String: AnyObject] = [\"timePassed\" : 30]\nElastiCode .event(\"finished registration flow\", attributes: attributes) ", "language": "objectivec", "name": "Swift" } ] } [/block] [block:callout] { "type": "info", "body": "Adding your own keys are possible, but they should receive only Boolean, Int, Double and String values.", "title": "Share your own parameters!" } [/block]