{"_id":"570e17e95ff0f032005d1e1e","__v":7,"parentDoc":null,"user":"56e960b2d825061900d1abdd","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"},"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"},"githubsync":"","project":"56e96242d825061900d1abe8","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-13T09:56:57.108Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"The page method lets you send custom page tracking events to all of your installed apps.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"```javascript\\nstackpile.analytics.page(name, [data], [settings], callback);\\n```\",\n  \"title\": \"\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"| Parameter | Required | Description |\\n| -------- | --------------- | --------- |\\n| `name` | Yes | This is the name of the page you'd like to track. This is a required parameter. |\\n| `data`   | No | An object containing the custom data you would like to send with the page tracking 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 `page` to send custom data to your installed apps:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"stackpile.analytics.page('product_detail', {\\n\\tall: {\\n    category: 'Kitchen',\\n    sku: '3278'\\n  },\\n  optimizely: {\\n\\t\\tprice: 6999\\n  }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\nThis will send `page: \"product_detail\"` with custom properties set for `category` and `sku` to all installed apps that support page tracking and `price: 6999` to Optimizely.\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| `optimizely` | Optimizely |\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Currently we only support the page event for Optimizely. We are in the process of enabling this for other integrations as well.\",\n  \"title\": \"Page Event Support\"\n}\n[/block]","excerpt":"","slug":"page","type":"basic","title":"Page"}
The page method lets you send custom page tracking events to all of your installed apps. [block:callout] { "type": "info", "body": "```javascript\nstackpile.analytics.page(name, [data], [settings], callback);\n```", "title": "" } [/block] [block:callout] { "type": "info", "body": "| Parameter | Required | Description |\n| -------- | --------------- | --------- |\n| `name` | Yes | This is the name of the page you'd like to track. This is a required parameter. |\n| `data` | No | An object containing the custom data you would like to send with the page tracking 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 `page` to send custom data to your installed apps: [block:code] { "codes": [ { "code": "stackpile.analytics.page('product_detail', {\n\tall: {\n category: 'Kitchen',\n sku: '3278'\n },\n optimizely: {\n\t\tprice: 6999\n }\n});", "language": "javascript", "name": "" } ] } [/block] This will send `page: "product_detail"` with custom properties set for `category` and `sku` to all installed apps that support page tracking and `price: 6999` to Optimizely. You can use the following custom data properties to send data to selected apps: | Property | App | | --------- | ------- | | `all` | All installed apps | | `optimizely` | Optimizely | [block:callout] { "type": "warning", "body": "Currently we only support the page event for Optimizely. We are in the process of enabling this for other integrations as well.", "title": "Page Event Support" } [/block]