{"_id":"56ec0a5abd0cec0e00f6c432","category":{"_id":"56ebe6213de6a00e0041fd7a","version":"56e96242d825061900d1abeb","pages":["56ebee0982acf0320096667f","56ec0a5abd0cec0e00f6c432"],"project":"56e96242d825061900d1abe8","__v":2,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-18T11:27:29.489Z","from_sync":false,"order":1,"slug":"unified-analytics","title":"Unified Analytics"},"project":"56e96242d825061900d1abe8","version":{"_id":"56e96242d825061900d1abeb","hasReference":true,"__v":5,"hasDoc":true,"project":"56e96242d825061900d1abe8","createdAt":"2016-03-16T13:40:18.429Z","releaseDate":"2016-03-16T13:40:18.428Z","categories":["56e96242d825061900d1abec","56ebe6213de6a00e0041fd7a","570f4a00a38d470e0060cabf","570f6a3a620fdd190017f7ca","570f6a46986c040e008f7b0d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"githubsync":"","user":"56e960b2d825061900d1abdd","__v":20,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-18T14:02:02.876Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The identify method lets you send custom data to all your installed apps to identify your users.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"\",\n  \"body\": \"```javascript\\nstackpile.analytics.identify(id, [data], [settings], callback);\\n```\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"| Parameter | Required | Description |\\n| -------- | --------------- | --------- |\\n| `id` | Yes | An Id that uniquely identifies the user in your application. This can be a number `100029` or an email address `joe:::at:::example.com`. This Id should be something that never changes for a user.  |\\n| `data`   | No | An object containing the custom data you would like to send with the identify event. Data can be sent to `all` installed apps, or individual apps, for example `mixpanel` or `heap`. See examples below for more info. |\\n| `settings` | No | An object containing StackPile specific options. Currently only supports `timeout` to set the timeout duration before the `callback` function is called.|\\n| `callback` | No | A function that is called after the set `timeout`. Can be used if you need to wait before continuing with a process on your page.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\nA few examples of how you can use `identify` to send custom people data to your installed apps:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"stackpile.analytics.identify('100029', {\\n\\tall: {\\n\\t\\tname: 'Joe Smith',\\n\\t\\temail: '[email protected]'\\n\\t},\\n  mixpanel: {\\n    created: 1458309881\\n  }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThis will send the `id`, `name` and `email` to all installed apps and `$created` to Mixpanel.\n\nYou can use the following custom data properties to send data to selected apps:\n\n| Property | App |\n| --------- | ------- |\n| `all` | All installed apps | \n| `aboardly` | [Aboardly](#aboardly) | \n| `amplitude` | Amplitude | \n| `castle` | Castle | \n| `customerio` | [Customer.io](#customerio) | \n| `googleanalytics` | Google Analytics |\n| `gosquared` | GoSquared |\n| `heap` | Heap |\n| `kissmetrics` | Kissmetrics |\n| `mixpanel` | [Mixpanel](#mixpanel) |\n| `optimizely` | Optimizely |\n| `smooch` | [Smooch](#smooch) |\n| `webengage` | WebEngage |\n| `woopra` | [Woopra](#woopra) |\n| `wootric` | [Wootric](#wootric) |\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Aboardly\"\n}\n[/block]\nAboardly requires a user to be identified before any tracking event is sent. We automatically send a `signed_up` event after the user has been identified. You can customize this event by setting the `event` property of the `aboardly` object. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"stackpile.analytics.identify('100140', {\\n\\tall: {\\n\\t\\tname: 'Kevin Jones',\\n\\t\\temail: '[email protected]'\\n\\t},\\n  aboardly: {\\n    event: 'logged_in'\\n  }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nAboardly event names are automatically converted to slugs. For example, `Logged In` would be sent as `logged_in`.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Customer.io\"\n}\n[/block]\nCustomer.io requires the `id`, `email` and `created_at` properties to be set when identifying a user. If you don't want to set `email` and `created_at` for all your integrations you can customize the properties sent to the `identify` method. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"stackpile.analytics.identify('100132', {\\n\\tall: {\\n\\t\\tname: 'Sam Stone',\\n\\t\\temail: '[email protected]'\\n\\t},\\n  customerio: {\\n    created_at: 1339438758\\n  }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Mixpanel\"\n}\n[/block]\nMixpanel has a few special properties available to identify a person. We automatically transform the `email`, `created` and `name` properties to the special properties if they are set.\n\n| Property | Mixpanel Property |\n| ---- | ----- |\n| `email` | `$email` |\n| `created` | `$created` |\n| `name` | `$name` |\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Smooch\"\n}\n[/block]\nSmooch has a few special properties available to identify a person. We will check to see if `givenName`, `surname` or `userId` are set and pass those to Smooch. The rest of the properties are sent as custom properties.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"stackpile.analytics.identify('100433', {\\n\\tall: {\\n\\t\\tname: 'Pat Sloe',\\n\\t\\temail: '[email protected]'\\n\\t},\\n  smooch: {\\n    givenName: 'Patsy',\\n    surname: 'Sloe',\\n    userId: '12345'\\n  }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Woopra\"\n}\n[/block]\nWoopra requires an `email` property to be set to identify the user. If no `email` property is present, we will default to the `id`.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Wootric\"\n}\n[/block]\nWootric requires an `email` property to be set to identify the user. If no `email` property is present, we will default to the `id`.\n\nWootric will be triggered as soon as the `identify` call is made.","excerpt":"","slug":"identify","type":"basic","title":"Identify"}
The identify method lets you send custom data to all your installed apps to identify your users. [block:callout] { "type": "info", "title": "", "body": "```javascript\nstackpile.analytics.identify(id, [data], [settings], callback);\n```" } [/block] [block:callout] { "type": "info", "body": "| Parameter | Required | Description |\n| -------- | --------------- | --------- |\n| `id` | Yes | An Id that uniquely identifies the user in your application. This can be a number `100029` or an email address `[email protected]`. This Id should be something that never changes for a user. |\n| `data` | No | An object containing the custom data you would like to send with the identify event. Data can be sent to `all` installed apps, or individual apps, for example `mixpanel` or `heap`. See examples below for more info. |\n| `settings` | No | An object containing StackPile specific options. Currently only supports `timeout` to set the timeout duration before the `callback` function is called.|\n| `callback` | No | A function that is called after the set `timeout`. Can be used if you need to wait before continuing with a process on your page." } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] A few examples of how you can use `identify` to send custom people data to your installed apps: [block:code] { "codes": [ { "code": "stackpile.analytics.identify('100029', {\n\tall: {\n\t\tname: 'Joe Smith',\n\t\temail: '[email protected]'\n\t},\n mixpanel: {\n created: 1458309881\n }\n});", "language": "javascript" } ] } [/block] This will send the `id`, `name` and `email` to all installed apps and `$created` to Mixpanel. You can use the following custom data properties to send data to selected apps: | Property | App | | --------- | ------- | | `all` | All installed apps | | `aboardly` | [Aboardly](#aboardly) | | `amplitude` | Amplitude | | `castle` | Castle | | `customerio` | [Customer.io](#customerio) | | `googleanalytics` | Google Analytics | | `gosquared` | GoSquared | | `heap` | Heap | | `kissmetrics` | Kissmetrics | | `mixpanel` | [Mixpanel](#mixpanel) | | `optimizely` | Optimizely | | `smooch` | [Smooch](#smooch) | | `webengage` | WebEngage | | `woopra` | [Woopra](#woopra) | | `wootric` | [Wootric](#wootric) | [block:api-header] { "type": "basic", "title": "Aboardly" } [/block] Aboardly requires a user to be identified before any tracking event is sent. We automatically send a `signed_up` event after the user has been identified. You can customize this event by setting the `event` property of the `aboardly` object. For example: [block:code] { "codes": [ { "code": "stackpile.analytics.identify('100140', {\n\tall: {\n\t\tname: 'Kevin Jones',\n\t\temail: '[email protected]'\n\t},\n aboardly: {\n event: 'logged_in'\n }\n});", "language": "javascript" } ] } [/block] Aboardly event names are automatically converted to slugs. For example, `Logged In` would be sent as `logged_in`. [block:api-header] { "type": "basic", "title": "Customer.io" } [/block] Customer.io requires the `id`, `email` and `created_at` properties to be set when identifying a user. If you don't want to set `email` and `created_at` for all your integrations you can customize the properties sent to the `identify` method. For example: [block:code] { "codes": [ { "code": "stackpile.analytics.identify('100132', {\n\tall: {\n\t\tname: 'Sam Stone',\n\t\temail: '[email protected]'\n\t},\n customerio: {\n created_at: 1339438758\n }\n});", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Mixpanel" } [/block] Mixpanel has a few special properties available to identify a person. We automatically transform the `email`, `created` and `name` properties to the special properties if they are set. | Property | Mixpanel Property | | ---- | ----- | | `email` | `$email` | | `created` | `$created` | | `name` | `$name` | [block:api-header] { "type": "basic", "title": "Smooch" } [/block] Smooch has a few special properties available to identify a person. We will check to see if `givenName`, `surname` or `userId` are set and pass those to Smooch. The rest of the properties are sent as custom properties. [block:code] { "codes": [ { "code": "stackpile.analytics.identify('100433', {\n\tall: {\n\t\tname: 'Pat Sloe',\n\t\temail: '[email protected]'\n\t},\n smooch: {\n givenName: 'Patsy',\n surname: 'Sloe',\n userId: '12345'\n }\n});", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Woopra" } [/block] Woopra requires an `email` property to be set to identify the user. If no `email` property is present, we will default to the `id`. [block:api-header] { "type": "basic", "title": "Wootric" } [/block] Wootric requires an `email` property to be set to identify the user. If no `email` property is present, we will default to the `id`. Wootric will be triggered as soon as the `identify` call is made.