{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/Attribution.track(event, [properties], [callback]);","auth":"required","params":[{"name":"event","type":"string","default":"","desc":"The name of the event","required":true,"in":"body","ref":"","_id":"560ca0517048021700e180e9"},{"name":"properties","type":"object","default":"","desc":"A hashtable of properties describing the event.","required":false,"in":"body","ref":"","_id":"560ca0517048021700e180e8"},{"name":"callback","type":"object","default":"","desc":"A callback function that gets called after a short timeout.","required":false,"in":"body","ref":"","_id":"560ca0517048021700e180e7"}],"examples":{"codes":[{"language":"javascript","code":"Attribution.track(event, [properties], [callback]);","name":""}]},"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Page","type":"fn","slug":"page","excerpt":"Page is used to record page views as a customer clicks through your site.","body":"Page is called on page load automatically (it is included in the Attribution app 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]","updates":[],"order":2,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"560d74751ec45619006069e9","category":{"sync":{"isSync":false,"url":""},"pages":["560ca0517048021700e180e6","560d6190af9723190093812c","560d74751ec45619006069e9","560d769505b3941700338762"],"title":"JavaScript API (client-side)","slug":"javascript-api-client-side","order":1,"from_sync":false,"reference":true,"_id":"560c9d9399bb5a0d0044f220","project":"560c93ad7e9b9d0d00ca81a2","version":"560c93ae7e9b9d0d00ca81a5","__v":4,"createdAt":"2015-10-01T02:42:27.154Z"},"githubsync":"","project":"560c93ad7e9b9d0d00ca81a2","user":"560c92f2ac2859170013faa3","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["560c93af7e9b9d0d00ca81a6","560c9d9399bb5a0d0044f220","560d76d899bb5a0d0044f307","560d76ee1ec45619006069ed","560d86e099bb5a0d0044f32e","560dba80373c0e0d0024ff3b","57c722ecdf19130e001fba5d","57c743d1b6f94a2200659903","58995ec083f743190077bbe2"],"_id":"560c93ae7e9b9d0d00ca81a5","project":"560c93ad7e9b9d0d00ca81a2","createdAt":"2015-10-01T02:00:14.709Z","releaseDate":"2015-10-01T02:00:14.709Z","__v":9},"createdAt":"2015-10-01T17:59:17.429Z","editedParams":true,"editedParams2":true,"parentDoc":null,"__v":1}

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 app 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]