- 28 Dec 2023
- 1 Minute to read
Page Object
- Updated on 28 Dec 2023
- 1 Minute to read
Page Object includes the properties of the current page (e.g. Home, Product, Listing, Confirmation). If the page type (or breadcrumb) can be changed without reloading the page, this object must be updated too.
What are the prerequisites?
- Insider tag must be implemented.
- Insider object must be defined before the Insider tag. Otherwise Insider tag cannot read any information from the Insider object.
What are the properties?
The Page object has the following properties.
Key | Property | Type | Definition | Required |
---|---|---|---|---|
type | Page Type | String | Includes the page properties as in Home, Product, Category, Search, Basket, Checkout, Confirmation, Content. Page Type value should start with an upper case. | Yes |
What are the things to keep in mind?
When integrating the object, the following factors should be considered.
Change the value of the key
Make sure to change the value of the key based on your page type as Home, Product, Category, Search, Basket, Checkout, Confirmation or Content.
Code for the confirmation page
Upon adding the Code for Confirmation Page, review to make sure:
- The page type is Confirmation for all transactions made with all payment types (payment on delivery, credit card, bank transfer). If you want to exclude any payment method or payment for specific products (e.g. free product samples, wholesale products, etc.), you should not return such transactions as Confirmation.
- If a transaction fails, the type does not show Confirmation.
- If it is a single page, be sure that the page object includes the correct information. For example, once a user navigates to another page after the Confirmation page, the page object should also state this change and not display the type as Confirmation.
Sample Code
Below is a sample code for the Page object on a Confirmation page.
window.insider_object = window.insider_object || {};
window.insider_object.page = {
"type": "Confirmation"
}
How can I monitor if it works correctly?
Once you deploy your integration, you can test it via different methods.
Insider Object Integration Wizard
This wizard helps you complete your integration and test it afterwards. If you have already implemented the integration, you can use the wizard only to test it as well. See more on the Insider Object Integration Wizard.
Browser Test
You can visit your website and navigate to a page where you want to test the Page object.
- Right click on your website to inspect the page.
- Go to Developer Console.
- Run insider_object or insider_object.page to see your object.
- Make sure that it follows the criteria stated in the properties.