{"_id":"57d5404fe2e70e20009cda0f","__v":0,"user":"548d74b716fc980b00e2a786","project":"54861bb654b3ce0b00367292","version":{"_id":"57b96d6b1d08500e00bf81d1","__v":7,"project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"category":{"_id":"57d52b5cf350090e00fe073e","__v":0,"version":"57b96d6b1d08500e00bf81d1","project":"54861bb654b3ce0b00367292","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-11T10:01:00.892Z","from_sync":false,"order":4,"slug":"android-app-triggers","title":"Android / App triggers"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-11T11:30:23.794Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":3,"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\n1.Key value attribution (bool , int , double  , string)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"params.data.addSessionAttributes(Map<String,Object>);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n2. [Source Attribution](doc:source-attr) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"params.data.addSessionAppsFlyerAttributes(Map<String,Object>);\\n\\nparams.data.addSessionAdjustAttributes(Map<String,Object>);\\n\\nparams.data.addSessionBranchIOAttributes(Map<String,Object>);\\n\\nparams.data.addSessionButtonAttributes(Map<String,Object>);\\n\\nparams.data.addSessionKochavaAttributes(Map<String,Object>);\",\n      \"language\": \"java\"\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\": \"Map<String, Object> userInfo = new HashMap<String, Object>();\\nuserInfo.put(\\\"Age\\\", 20.5);\\nuserInfo.put(\\\"Gender\\\", 0);\\nuserInfo.put(\\\"Location\\\", \\\"(37.700421688980136,-81.84535319999998)\\\");\\n\\nelasticode.shareUserInfo(userInfo);\",\n      \"language\": \"java\",\n      \"name\": \"Java\"\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\": \"java\"\n    }\n  ]\n}\n[/block]\nYou can also add parameters to that event:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Map<String, Object> attributes = new HashMap<String, Object>();\\nattributes.put(\\\"timePassed\\\", 30);\\nelasticode.eventWithAttributes(\\\"finished registration flow\\\", attributes);\",\n      \"language\": \"java\"\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":"Sharing user information​, session events and source attribution for a personalized interaction","slug":"user-infomration","type":"basic","title":"User infomration"}

User infomration

Sharing user information​, session events and source attribution for a personalized interaction

You can share information to drive deeper personalization capabilities, user data, user behavior and source attribution [block:api-header] { "type": "basic", "title": "Prior to starting the initial session:" } [/block] In order to apply these configurations, change the following code in your app delegate as following: 1.Key value attribution (bool , int , double , string) [block:code] { "codes": [ { "code": "params.data.addSessionAttributes(Map<String,Object>);", "language": "java" } ] } [/block] 2. [Source Attribution](doc:source-attr) [block:code] { "codes": [ { "code": "params.data.addSessionAppsFlyerAttributes(Map<String,Object>);\n\nparams.data.addSessionAdjustAttributes(Map<String,Object>);\n\nparams.data.addSessionBranchIOAttributes(Map<String,Object>);\n\nparams.data.addSessionButtonAttributes(Map<String,Object>);\n\nparams.data.addSessionKochavaAttributes(Map<String,Object>);", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Post initial session setup" } [/block] In addition, there are three relevant fixed types of information, or any key-value parameter. For 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. [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": "You can add your own keys, but they should receive only Boolean, Integer, Double and String values." } [/block] Use the following methods to share the relevant user info: [block:code] { "codes": [ { "code": "Map<String, Object> userInfo = new HashMap<String, Object>();\nuserInfo.put(\"Age\", 20.5);\nuserInfo.put(\"Gender\", 0);\nuserInfo.put(\"Location\", \"(37.700421688980136,-81.84535319999998)\");\n\nelasticode.shareUserInfo(userInfo);", "language": "java", "name": "Java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Adding events [post initial session setup]" } [/block] You can use the *event *method to share about user behaviors: [block:code] { "codes": [ { "code": "elasticode.event(\"finished registration flow\");", "language": "java" } ] } [/block] You can also add parameters to that event: [block:code] { "codes": [ { "code": "Map<String, Object> attributes = new HashMap<String, Object>();\nattributes.put(\"timePassed\", 30);\nelasticode.eventWithAttributes(\"finished registration flow\", attributes);", "language": "java" } ] } [/block] [block:callout] { "type": "info", "body": "You can add your own keys, but they should receive only Boolean, Integer, Double and String values.", "title": "Share your own parameters!" } [/block]