--- title: "InsiderEvent" slug: "webview-insiderevent" description: "Track custom events and ecommerce actions (cart, wishlist, page views) in the WebView SDK using InsiderEvent and tagEvent." updated: 2026-10-19T16:32:59Z published: 2026-10-19T16:32:59Z canonical: "academy.insiderone.com/webview-insiderevent" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # InsiderEvent The InsiderEvent helps you create custom events and event parameters in different data types. | Name | Description | Type | Required | | --- | --- | --- | --- | | name | Event name | String | Yes | | custom identifier | Use setter methods to change | Any | No | ## Set tagEvent This method creates and optionally builds events with the given name. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | name | String | Event name | Yes | Below are additional methods to attach attributes to an event: | Parameter | Type | Required | | --- | --- | --- | | addStringParameter | String | Yes | | addNumericParameter | Number | Yes | | addBooleanParameter | Boolean | Yes | | addDateParameter | Date | Yes | | addStringArrayParameter | [String] | Yes | | addNumericArrayParameter | [Number] | Yes | **Method signature** ```typescript tagEvent(string name) : Promise ``` **Method example** ```typescript const event = window.insider.tagEvent('custom_event');                    event                    .addStringParameter('custom_string', 'custom_string_value')                    .addNumericParameter('custom_integer', 123)                    .addNumericParameter('custom_double', 23.01)                    .addBooleanParameter('custom_boolean', true)                    .addDateParameter('custom_date', new Date())                    .addStringArrayParameter('custom_string_array', ['str1', 'str2', 'str3'])                    .addNumericArrayParameter('custom_numeric_array', [1, 2, 3, 4.4]);                    await event.build(); ``` ## Page visit events You should trigger the page visit events when a user visits the respective page type in the application. The default page visit events include the **Homepage View**, **Listing Page View**, **Product Detail Page View**, **Cart Page View**, and **Confirmation Page View**. See below for their method signatures and examples. ### visitHomePage This method creates and builds a homepage event. **Method signature** ```typescript visitHomePage() : Promise ``` **Method example** ```typescript await window.insider.visitHomePage(); ``` ### visitListingPage This method creates and builds a product listing page event. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | taxonomy | [String] | Product categories | Yes | **Method signature** ```typescript visitListingPage([string] taxonomy) : Promise ``` **Method example** ```typescript const taxonomy = ["Male", "T-shirt", "Insider"];                    await window.insider.visitListingPage(taxonomy); ``` ### visitProductDetailsPage This method creates and builds a detailed page event for the given product. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | product | InsiderProduct | Product object | Yes | **Method signature** ```typescript visitProductDetailsPage(InsiderProduct product) : Promise ``` **Method example** ```typescript const product = window.insider.createNewProduct(                    'productId',                    'productName',                    ['male', 't-shirt'],                    'https://localhost/1234/shirt_1.png',                    123.45,                    'USD'                    )                    await window.insider.visitProductDetailsPage(product); ``` ### visitCartPage This method creates and builds a cart-page event with the given products. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | products | [InsiderProduct] | Product objects | Yes | **Method signature** ```typescript visitCartPage([InsiderProduct] products) : Promise ``` **Method example** ```typescript const product = window.insider.createNewProduct(                    'productId',                    'productName',                    ['male', 't-shirt'],                    'https://localhost/1234/shirt_1.png',                    123.45,                    'USD'                    )                    await window.insider.visitCartPage([product]); ``` ### itemPurchased (Confirmation page view) This method creates and builds an item purchase event with the given order ID and product. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | orderID | String | Order identifier | Yes | | product | InsiderProduct | Product object | Yes | **Method signature** ```typescript itemPurchased(string orderID, InsiderProduct product) : Promise ``` **Method example** ```typescript const product = window.insider.createNewProduct(  'productId',  'productName',  ['male', 't-shirt'],  'https://localhost/1234/shirt_1.png',  123.45,  'USD' ) await window.insider.itemPurchased('orderId-12345', product); ``` ### visitWishlist This method creates and builds a wishlist event with the given products. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | products | [InsiderProduct] | Product objects | Yes | **Method signature** ```typescript visitWishlist([InsiderProduct] products) : Promise ``` **Method example** ```typescript const product = window.insider.createNewProduct(                    'productId',                    'productName',                    ['male', 't-shirt'],                    'https://localhost/1234/shirt_1.png',                    123.45,                    'USD'                    )                    await window.insider.visitWishlist([product]); ``` ## Wishlist events You should trigger the wishlist events when a user takes the action for the respective type of wishlist moves in the application. The default wishlist events include the **Item Added to Wishlist**, **Item Removed from Wishlist**, and **Wishlist Cleared**. See below for their method signatures and examples. ### itemAddedToWishlist This method creates and builds an item added to wishlist event with the given product. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | product | InsiderProduct | Product object | Yes | **Method example** ```typescript itemAddedToWishlist(InsiderProduct product) : Promise ``` **Method signature** ```typescript const product = window.insider.createNewProduct(                    'productId',                    'productName',                    ['male', 't-shirt'],                    'https://localhost/1234/shirt_1.png',                    123.45,                    'USD'                    )                    await window.insider.itemAddedToWishlist(product); ``` ### itemRemovedFromWishlist This method creates and builds an item removed from wishlist event with the given product id. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | productID | String | Product identifier | Yes | **Method signature** ```typescript itemRemovedFromWishlist(string productID) : Promise ``` **Method example** ```typescript await window.insider.itemRemovedFromWishlist('productId'); ``` ### wishlistCleared This method creates and builds a clear wishlist event. **Method signature** ```typescript wishlistCleared() : Promise ``` **Method example** ```typescript await window.insider.wishlistCleared(); ``` ## Cart events You should trigger the cart events when a user takes the action for the respective type of cart moves in the application. The default cart events include the **Item Added to Cart**, **Item Removed from Cart**, and **Cart Cleared**. See below for their method signatures and examples. ### itemAddedToCart This method creates and builds an item added to cart event with the given product. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | product | InsiderProduct | Product object | Yes | **Method signature** ```typescript itemAddedToCart(InsiderProduct product) : Promise ``` **Method example** ```typescript const product = window.insider.createNewProduct(                    'productId',                    'productName',                    ['male', 't-shirt'],                    'https://localhost/1234/shirt_1.png',                    123.45,                    'USD'                    )                    await window.insider.itemAddedToCart(product); ``` ### itemRemovedFromCart This method creates and builds an item removed from cart event with the given product id. | Parameter | Type | Description | Required | | --- | --- | --- | --- | | productID | String | Product identifier | Yes | **Method signature** ```typescript itemRemovedFromCart(string productID) : Promise ``` **Method example** ```typescript await window.insider.itemRemovedFromCart('productId'); ``` ### cartCleared This method creates and builds a clear cart event. **Method signature** ```typescript cartCleared() : Promise ``` **Method example** ```typescript await window.insider.cartCleared(); ```