{"_id":"560d74751ec45619006069e9","category":{"_id":"560c9d9399bb5a0d0044f220","pages":["560ca0517048021700e180e6","560d6190af9723190093812c","560d74751ec45619006069e9","560d769505b3941700338762"],"project":"560c93ad7e9b9d0d00ca81a2","version":"560c93ae7e9b9d0d00ca81a5","__v":4,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-10-01T02:42:27.154Z","from_sync":false,"order":0,"slug":"javascript-api-client-side","title":"JavaScript API (client-side)"},"project":"560c93ad7e9b9d0d00ca81a2","user":"560c92f2ac2859170013faa3","version":{"_id":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","__v":9,"createdAt":"2015-10-01T02:00:14.709Z","releaseDate":"2015-10-01T02:00:14.709Z","categories":["560c93af7e9b9d0d00ca81a6","560c9d9399bb5a0d0044f220","560d76d899bb5a0d0044f307","560d76ee1ec45619006069ed","560d86e099bb5a0d0044f32e","560dba80373c0e0d0024ff3b","57c722ecdf19130e001fba5d","57c743d1b6f94a2200659903","58995ec083f743190077bbe2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"editedParams":true,"editedParams2":true,"parentDoc":null,"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-01T17:59:17.429Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"Attribution.track(event, [properties], [callback]);","language":"javascript"}]},"results":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"560ca0517048021700e180e9","ref":"","in":"body","required":true,"desc":"The name of the event","default":"","type":"string","name":"event"},{"_id":"560ca0517048021700e180e8","ref":"","in":"body","required":false,"desc":"A hashtable of properties describing the event.","default":"","type":"object","name":"properties"},{"_id":"560ca0517048021700e180e7","ref":"","in":"body","required":false,"desc":"A callback function that gets called after a short timeout.","default":"","type":"object","name":"callback"}],"url":"/Attribution.track(event, [properties], [callback]);"},"isReference":true,"order":2,"body":"Page is called on page load automatically (it is included in the Attribution snippet). You only need to call page if you have a single page app or you want to pass in the name of the page.\n\nUnder the hood, page just calls track with the event name ‘Viewed a Page’ as the event name and the URL as a property.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Attribution.page([name], [callback]);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**name** \\n*String, optional*\",\n    \"0-1\": \"The name of the of the page, for example Signup or Home.\",\n    \"1-0\": \"**callback** \\n*Object, optional*\",\n    \"1-1\": \"A callback function that gets called after a short timeout.\",\n    \"2-1\": \"## A callback function that gets called after a short timeout.\",\n    \"2-0\": \"\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Attribution.page('Signup');\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"Page is used to record page views as a customer clicks through your site.","slug":"page","type":"fn","title":"Page"}

Page

Page is used to record page views as a customer clicks through your site.

Page is called on page load automatically (it is included in the Attribution snippet). You only need to call page if you have a single page app or you want to pass in the name of the page. Under the hood, page just calls track with the event name ‘Viewed a Page’ as the event name and the URL as a property. [block:code] { "codes": [ { "code": "Attribution.page([name], [callback]);", "language": "javascript" } ] } [/block] [block:parameters] { "data": { "0-0": "**name** \n*String, optional*", "0-1": "The name of the of the page, for example Signup or Home.", "1-0": "**callback** \n*Object, optional*", "1-1": "A callback function that gets called after a short timeout.", "2-1": "## A callback function that gets called after a short timeout.", "2-0": "" }, "cols": 2, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "Attribution.page('Signup');", "language": "javascript" } ] } [/block]