Page is used to record page views as a customer clicks through your site.
Warning!
- The JavaScript API (Client-Side) articles are intended for developers!
- Attribution should be installed by a developer.
page()
can be installed with Google Tag Manager.- Do not minify or bundle Attribution snippet inside a webpack or it may render unstable in some conditions.
- Please try to avoid putting snippet inside a JS closure. You are still free to call
page()
from inside your JS app usingwindow.Attribution
variable.
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.
Attribution.page([name], [callback]);
Parameter (type) | Description |
---|---|
name String, optional | The name of the of the page, for example Signup or Home. |
callback Object, optional | A callback function that gets called after a short timeout. |
Attribution.page('Signup');