Suggested Readings: Guide to Events and Attributes, Data Collection, Data Ingestion
Insider’s Web SDK enables seamless data collection and real-time personalization by capturing detailed data on user attributes, behaviors, and interactions across your website. Once the integration is complete, you can immediately use this robust and unified data for customer identification, purchase tracking, and revenue analysis. This provides the foundation to personalize your users’ experience with dynamic content, create advanced segmentation with the help of attributes, and target users effectively across channels like Email, SMS, WhatsApp, and Facebook Custom Audiences channels.
This guide aims to provide a complete outline of the following:
When it comes to data collection, Insider products use two data structures: Events and Attributes.
An event defines all the actions your users perform while interacting with your website, application, campaigns, and/or offline stores (e.g., viewing a page, adding an item to cart, completing a purchase, etc.).
An attribute defines all the details about a user. It helps you understand their preferences such as personal information, last purchased and visited products, etc.
With a complete Insider Web SDK integration, you can:
- Set and update attributes,
- Keep track of users’ visited products,
- Detect the page types and actions taken on these pages,
- Track customer behavior and purchase history,
- Share consent information with Insider,
- Unify user data across platforms,
- Get accurate metrics like conversions, conversion rates, and revenue,
- Set initialization rules to trigger data processing where needed.
Integration platforms
You can configure your integration via one of the various methods of your choosing:
- Source code integration: This guide primarily focuses on adding scripts directly to your website's source code.
- Google Tag Manager (GTM): A comprehensive set of details for GTM integration is provided in a dedicated section. You are required to follow this document along with that specific section. The principles can also be adapted for other tag managers.
- Other tag managers: You can consult the Insider One team for tag managers like Tealium Tag Manager or Adobe Launch.
Required implementation flow
This section provides a high-level overview of the integration flow. It introduces the main components of the SDK setup. You can follow the rest of this guide to configure these components.

A typical integration follows an order as below:
- The InsiderQueue array must be defined before the Insider tag loads. This is the queue where all integration data will be pushed.
- Then, load the Insider tag (ins.js).
- Push the user data: attributes (type: ‘user'), the user’s current currency (type: 'currency') if needed, and items currently in the user's cart if preferred (type: 'cart'). You can push these components in any order.
- After the user data, push the correct page type to define the current page context (e.g., type: 'home', type: 'product').
- At the end, push type: 'init' to signal Insider tag that the full data is ready. This triggers a page view event and updates the user profile. This is the most critical push in the Insider's Web SDK.
- Event pushes such as type: 'add_to_cart', type: 'remove_from_cart', and type: 'custom_event' should be triggered by your site logic as needed, but only after the Insider tag is loaded.
Integration
You can follow these steps to configure the integration.
Insider Queue array
The InsiderQueue is a JavaScript array you define on your website. Its purpose is to collect all user attributes, page details, and events before the Insider tag processes them.
To implement it, you must add the following line of code to every page where you will use the SDK. You must place this script before the Insider tag (ins.js).
window.InsiderQueue = window.InsiderQueue || [];- The InsiderQueue array must be set once on each page where you plan to utilize it. If the InsiderQueue is not defined, the Insider tag will still work, but you won’t be able to push data into the array.
- The InsiderQueue shouldn’t be empty. If it is defined, you should at least define the page type and push the type: ‘init’ method.
- If you don’t want to preserve InsiderQueue between pages, you can define it as window.InsiderQueue = []; as well, but it is optional.
Insider Tag (ins.js)
Insider Tag integration is the core script that tracks user behavior, such as purchase and visit history, processes the data from the InsiderQueue, and enables all Insider functionalities on your website. Below, you can find the example script for Insider tag.
<script async src="//{partnerName}.api.useinsider.com/ins.js?id={partnerId}"></script>- To configure the InsiderQueue, the Insider tag (ins.js) is required to track user behavior and actions.
- Make sure you add the Insider tag (ins.js) to all pages on your website without any modification in the <head></head> tag after the InsiderQueue array definition.
- This script loads asynchronously by default, and does not block any other script on your website or the rendering of your web pages.
User data - Attributes
With the type: 'user' method, you define your user's default and custom attributes. This allows Insider to identify, unify, and track users correctly based on your Identity Resolution Management settings.
It is highly recommended to push all available user information every time you send a type: ‘user’ push. This practice ensures data consistency across all user identification and unification scenarios.
While defining your user’s attributes, you must follow the data table below for data types and requirements.
| Attribute | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| gender | Gender of the user. The values can be F or M. | String | M | No |
| birthday | Birthday of the user | Datetime | 1990-01-14 | No |
| name | Name of the user | String | John | No |
| surname | Surname of the user | String | Doe | No |
| age | Age of the user | Number | 33 | No |
| Email address of the user | String | jdoe@useinsider.com | No* | |
| email_optin | Indicates if the user has opted in for emails | Boolean | true | No |
| phone_number | Phone number of the user in E.164 format | String | +120394879878 | No* |
| sms_optin | Indicates if the user has opted in for SMS | Boolean | true | No |
| language | Language of the user | String | en_US | No** |
| city | City of the user | String | Jakarta | No |
| country | Country of the user | String | Indonesia | No |
| uuid | Unique user ID of the user | String | INS123 | No* |
| gdpr_optin | Indicates if the user has allowed for cookies | Boolean | true | No*** |
| whatsapp_optin | Indicates if the user has opted in for WhatsApp messages | Boolean | false | No |
| custom | Object for custom user attributes | Object | {"membership": "Silver"} | No |
*No identifier is marked required in the table above, including Insider’s default identifier set: uuid, email, and phone_number. If you are using any default or custom attributes as identifiers, you must define them in this push for a correct unification and identification process.
**The language attribute is required for many cases. For example, if you want to show your campaigns to users based on their language, this attribute is required. It is advised to define the user’s language in all pages to avoid any difficulties.
***The gdpr_optin is required for customers that are subject to the GDPR Laws. When it is defined as false, campaigns (except cookieless cases) will not be displayed and Insider messages will not be sent. If it is not defined, it will be accepted as true.
Below, you can find the example script for the type: ‘user’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'user',
value: {
"uuid": "INS123",
"gender": "M",
"birthday": "1990-01-14",
"gdpr_optin": true,
"name": "John",
"surname": "Doe",
"username": "jdoe",
"age": 33,
"email": "jdoe@useinsider.com",
"email_optin": true,
"phone_number": "+120394879878",
"sms_optin": true,
"language": "en_US",
"city": "Jakarta",
"country": "Indonesia",
"whatsapp_optin": true,
"custom": {
"user_lifetime": 23,
"membership_type": "Silver"
}
}
});User data - Currency
With the type: ‘currency’ method, you define the currency that is currently used by the user to view your website. This method is essential for customers supporting multiple currencies. It is used while converting the price information in the InsiderQueue events and using the correct currency while displaying a campaign with price information.
Below, you can find the example script for the type: ‘currency’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'currency',
value: 'USD'
});You can contact the Insider One team to skip the type: 'currency' method if you only allow a single currency on your website.
User data - Cart (optional)
The type: ‘cart’ method is used for defining the page type as a cart page and updating the user’s cart information for Insider. This means your user’s data will already be updated in every cart page view. However, if you are sensitive about the up-to-dateness of your cart data, you can use this method on every page to update the user’s cart information. This way, Insider will be up-to-date about the user’s cart regardless of page type. If not, you can skip this section and use the type: ‘cart’ method for defining cart page type and sending cart page view.
While defining your user’s cart items, you must follow the data table below for data types and requirements.
| Property | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| shipping_cost | Shipping cost of the item(s) in the cart | Float | 7.99 | No |
| total | Total price of the cart item(s) including shipping fees and taxes | Float | 273.99 | Yes |
| items | The list of cart items | Array | [{"id": "abc1234", "name": "Blue Dress", "taxonomy": ["Dresses", "Night Dresses", "Long Sleeve"]}] | Yes |
| id (for ‘items’) | Unique product ID of the product | String | abc1234 | Yes |
| name (for ‘items’) | Product name | String | Blue Dress | Yes |
| taxonomy (for ‘items’) | Category tree of the product | Array | ["Dresses", "Night Dresses", "Long Sleeve"] | Yes |
| unit_price (for ‘items’) | Price of the purchased product without any discount(s) | Float | 100.00 | Yes |
| unit_sale_price (for ‘items’) | Unit price of the product | Float | 95.20 | Yes |
| quantity (for ‘items’) | Number of items | Number | 2 | Yes |
| url (for ‘items’) | URL address of the product | String | https://posh.useinsider.com/blue-dress | Yes |
| stock (for ‘items’) | Stock information of the product that shows the number of products left in stock | Number | 11 | No |
| color (for ‘items’) | Color of the product selected by the user | String | Blue | No |
| size (for ‘items’) | Size of the product selected by the user | String | S | No |
| product_image_url (for ‘items’) | URL address of the product image | String | https://posh.useinsider.com/blue-dress.png | Yes |
| custom (for ‘items’) | Custom object that includes custom properties to be collected to Insider database as custom event parameters | Object | {"merchandiser": "store123"} | No |
Below, you can find the example script for the type: ‘cart’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'cart',
value: {
"shipping_cost": 7.99,
"total": 200.39,
"items": [{
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"unit_price": 90.00,
"unit_sale_price": 75,
"quantity": 2,
"url": "https://posh.useinsider.com/blue-dress",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "https://posh.useinsider.com/blue-dress.png",
"custom": {
"merchandiser": "store123"
}
}, {
"id": "zxc5678",
"name": "Yellow T-Shirt",
"taxonomy": [
"T-Shirts",
"Oversize"
],
"unit_price": 60.00,
"unit_sale_price": 50.39,
"quantity": 1,
"url": "https://posh.useinsider.com/yellow-tshirt/",
"stock": 11,
"color": "Yellow",
"size": "L",
"product_image_url": "https://posh.useinsider.com/yellow-tshirt.png"
}]
}
});Page data - Home
The type: ‘home' method defines the page type as home. With the type: ‘init’ method, it sends a Home Page View (home_page_view) event, which you can see on the User Profiles. You can define only one product per product page.
For this push to work, type: 'init' must be pushed once per page afterward.
Below, you can find the example script for the type: ‘home’ method of Insider Web SDK. Since the default parameters of Homepage View are sent automatically, you can only define custom parameters for this page type.
window.InsiderQueue.push({
type: 'home',
value: {
"custom": {
"home_page_version": "version1",
"daily_count": 14
}
}
});Page data - Category
The type: ‘category' method defines the page type as category/listing. With the type: ‘init’ method, it sends a Listing Page View (listing_page_view) event, which you can on the User Profiles.
For this push to work, type: 'init' must be pushed once per page afterward.
Below, you can find the example script for the type: ‘category’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'category',
value: {
breadcrumb: ['Dresses', 'Night Dresses'],
},
});Page data - Product
The type: ‘product' method defines the page type as home. With the type: ‘init’ method, it sends a Product Page View (product_detail_page_view) event, which you can observe on the User Profiles. You can define only one product per product page.
This is also why this method has some other optional product attributes / event parameters. They are not listed in the generic data table or example script, but you can implement them just like others in compliance with the data type provided below:
- groupcode property as string
- description property as string
- gtin property as string
- sku property as string
- brand property as string
- identifier_exists property as string
- locale property as string
- google_title property as string
- gender property as string (can be M or F)
- omnibus_price property as string
While defining the product page data, you must follow the data table below for data types and requirements.
| Property | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| id | Unique product ID of the product | String | abc1234 | Yes |
| groupcode | Used to group product variants | String | abc5678 | No |
| name | Product name | String | Blue Dress | Yes |
| taxonomy | Category tree of the product | Array | ["Dresses", "Night Dresses", "Long Sleeve"] | Yes |
| unit_price | Price of the purchased product without any discount(s) | Float | 100.00 | Yes |
| unit_sale_price | Unit price of the product | Float | 95.20 | Yes |
| url | URL address of the product | String | https://posh.useinsider.com/blue-dress | Yes |
| stock | Stock information of the product that shows the number of products left in stock | Number | 11 | No |
| color | Color of the product selected by the user | String | Blue | No |
| size | Size of the product selected by the user | String | S | No |
| product_image_url | URL address of the product image | String | https://posh.useinsider.com/blue-dress.png | Yes |
| custom | Custom object that includes custom properties to be collected to Insider database as custom event parameters | Object | {"merchandiser": "store123"} | No |
For this push to work, type: 'init' must be pushed once per page afterward
Below, you can find the example script for the type: ‘product’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'product',
value: {
"id": "abc1234",
"groupcode": "abd5678",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"unit_price": 100.00,
"unit_sale_price": 95.20,
"url": "https://posh.useinsider.com/blue-dress",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "https://posh.useinsider.com/blue-dress.png",
"custom": {
"merchandiser": "store123"
}
}
});Page data - Cart
The type: ‘cart' method defines the page type as cart and updates the user’s cart information for Insider. With the type: ‘init’ method, it sends a Cart Page View (cart_page_view) event, which you can observe on the User Profiles.
The User data - Cart method is used for updating the user’s cart information for Insider. Since it also defines the page type as cart, you just need to push/fire the type: ‘cart’ method once on your cart page. If you already added (or fired) this method on your cart page to update the user’s cart information, you can skip this section of the integration because the page type is already defined as cart.
While defining cart page data, you must follow the data table below for data types and requirements.
| Property | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| shipping_cost | Shipping cost of the item(s) in the cart | Float | 7.99 | No |
| total | Total price of the cart item(s) including shipping fees and taxes | Float | 273.99 | Yes |
| items | The list of cart items | Array | [{"id": "abc1234", "name": "Blue Dress", "taxonomy": ["Dresses", "Night Dresses", "Long Sleeve"]}] | Yes |
| id (for ‘items’) | Unique product ID of the product | String | abc1234 | Yes |
| name (for ‘items’) | Product name | String | Blue Dress | Yes |
| taxonomy (for ‘items’) | Category tree of the product | Array | ["Dresses", "Night Dresses", "Long Sleeve"] | Yes |
| unit_price (for ‘items’) | Price of the purchased product without any discount(s) | Float | 100.00 | Yes |
| unit_sale_price (for ‘items’) | Unit price of the product | Float | 95.20 | Yes |
| quantity (for ‘items’) | Number of items | Number | 2 | Yes |
| url (for ‘items’) | URL address of the product | String | https://posh.useinsider.com/blue-dress | Yes |
| stock (for ‘items’) | Stock information of the product that shows the number of products left in stock | Number | 11 | No |
| color (for ‘items’) | Color of the product selected by the user | String | Blue | No |
| size (for ‘items’) | Size of the product selected by the user | String | S | No |
| product_image_url (for ‘items’) | URL address of the product image | String | https://posh.useinsider.com/blue-dress.png | Yes |
| custom (for ‘items’) | Custom object that includes custom properties to be collected to Insider database as custom event parameters | Object | {"merchandiser": "store123"} | No |
For this push to work, type: 'init' must be pushed once per page afterward.
Below, you can find the example script for the type: ‘cart’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'cart',
value: {
"shipping_cost": 7.99,
"total": 200.39,
"items": [{
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"unit_price": 90.00,
"unit_sale_price": 75,
"quantity": 2,
"url": "https://posh.useinsider.com/blue-dress",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "https://posh.useinsider.com/blue-dress.png",
"custom": {
"merchandiser": "store123"
}
}, {
"id": "zxc5678",
"name": "Yellow T-Shirt",
"taxonomy": [
"T-Shirts",
"Oversize"
],
"unit_price": 60.00,
"unit_sale_price": 50.39,
"quantity": 1,
"url": "https://posh.useinsider.com/yellow-tshirt/",
"stock": 11,
"color": "Yellow",
"size": "L",
"product_image_url": "https://posh.useinsider.com/yellow-tshirt.png"
}]
}
});Imagine you have a mini cart page in a single page structure appended to a product page.
You will define InsiderQueue, user data, and page data when a user comes to this product page, then push type: ‘init' and load the Insider tag. If your user visits the mini cart, you will push the type: ‘cart’ method to define the page type as cart (also to define the cart items), then you will follow it up with type: ‘init’ to trigger the page view with the last page data definition. You don’t need to load the Insider tag again since it is already loaded (and if your mini cart is appended as a single page structure).
If you don’t send type: ‘cart’, the system will assume it is a product page for your campaign rules.
If you don’t send type: 'init', the page type will be cart, but it will not send the Cart Page View event.
When your user closes the mini cart page and returns, push type: ‘product' to set the page type back to product page, and push type: 'init’ to send the Product Page View event.
You can also use custom attributes/parameters to differentiate a mini cart page view from other default cart page views.
Page data - Purchase
The type: ‘purchase' method defines the page type as purchase and updates the user’s cart information for Insider. With the type: ‘init’ method, it sends a Purchase (confirmation_page_view) event, which you can observe on the User Profiles. This method is highly crucial for Insider functions.
While defining the purchase page data, you must follow the data table below for data types and requirements.
| Key | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| order_id | Order ID of the transaction | String | INS2468 | Yes |
| total | Total price of the transaction including shipping fees and taxes | Float | 273.39 | Yes |
| shipping_cost | Shipping cost of the item(s) in the cart | Float | 7.99 | No |
| items | The list of purchased items | Array | [{"id": "abc1234", "name": "Blue Dress", "taxonomy": ["Dresses", "Night Dresses", "Long Sleeve"]}] | Yes |
| id (for 'items') | Unique product ID of the purchased product | String | abc1234 | Yes |
| name (for 'items') | Name of the purchased product | String | Blue Dress | Yes |
| taxonomy (for 'items') | Category tree of the product | Array | ["Dresses", "Night Dresses", "Long Sleeve"] | Yes |
| unit_price (for 'items') | Price of the purchased product without any discount(s) | Float | 100.00 | Yes |
| unit_sale_price (for 'items') | Unit price of the purchased product | Float | 95.20 | Yes |
| url (for 'items') | URL address of the purchased product | String | https://push.useinsider.com/dresses/blue-dress-abc1234 | Yes |
| stock (for 'items') | Stock information of the product that shows the number of products left in stock | Number | 11 | No |
| color (for 'items') | Color of the product selected by the user | String | Blue | No |
| size (for 'items') | Size of the product selected by the user | String | S | No |
| product_image_url (for 'items') | URL address of the product image | String | https://posh.useinsider.com/blue-dress-image | Yes |
| quantity (for 'items') | Number of products | Number | 2 | Yes |
| custom (for 'items') | Custom object that includes custom properties to be collected to Insider database as custom event parameters | Object | {"season": "winter"} | No |
For this push to work, type: 'init' must be pushed once per page afterward.
Below, you can find the example script for the type: ‘purchase’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'purchase',
value: {
"order_id": "INS2468",
"total": 200.39,
"shipping_cost": 7.00,
"items": [{
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"unit_price": 90.00,
"unit_sale_price": 75.00,
"quantity": 2,
"url": "https://push.useinsider.com/dresses/blue-dress-abc1234",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "https://posh.useinsider.com/blue-dress-image",
"custom": {
"merchandiser": "store123"
}
}, {
"id": "zxc5678",
"name": "Yellow T-Shirt",
"taxonomy": [
"T-Shirts",
"Oversize"
],
"unit_price": 60.00,
"unit_sale_price": 50.39,
"quantity": 1,
"url": "https://posh.useinsider.com/yellow-tshirt/",
"stock": 11,
"color": "Yellow",
"size": "L",
"product_image_url": "https://posh.useinsider.com/yellow-tshirt.png",
"custom": {
"merchandiser": "store456"
}
}]
}
});Page data - Other
The type: ‘other' method defines the page type as other. With the type: ‘init’ method, it sends an Other Page View (other_page_view) event, which you can observe on the User Profiles. You can use this method to label any kind of page.
Only the name parameter is used to label the other pages with string data type. This parameter is not required and will be displayed in the User Profiles entries for Other Page View events. You can also use custom event parameters.
For this push to work, type: 'init' must be pushed once per page afterward.
Below, you can find the example script for the type: ‘other’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'other',
value: {
"name": "landing page v.2",
"custom": {
"landed_previously": false,
"traffic_source": "facebook"
}
}
});Initialization push — A critical step
type: ‘init' is the most critical yet basic method in the Web SDK integration. It acts as the trigger that tells the Insider tag to pass the user and page data you have defined to Insider.
Every time you push this method to InsiderQueue:
- It tells the Insider tag to be initialized if it isn’t initialized yet.
- User data according to the last successful type: 'user' push made will be sent to Insider.
- Page view event, according to the last successful page definition you made, will be sent to Insider.
- It will check which “Rules” (and some other settings) are satisfied to display correct campaigns to correct users.
The custom_event, add_to_cart, or remove_from_cart events do not require the type: ‘init’ method to be pushed afterward.
Below, you can find the example script for the type: ‘init’ method of Insider Web SDK.
window.InsiderQueue.push({
type: 'init'
});Your user data (attributes, currency, cart) will be preserved along with the branch and you can update it whenever you want. However, we advise you to use the user data along with others to keep the integration simple.
Add to cart and remove from cart
The type: ‘add_to_cart' and type: ‘remove_from_cart' methods update the user's cart information according to user’s action and sends the related event to Insider: add to cart (item_added_to_cart) or remove from cart (item_removed_from_cart).
While pushing these two events, you must follow the data table below for data types and requirements.
| Key | Description | Data Type | Sample Value | Required |
|---|---|---|---|---|
| id | Unique product ID of the purchased product | String | abc1234 | Yes |
| name | Name of the purchased product | String | Blue Dress | Yes |
| taxonomy | Category tree of the product | Array | ["Dresses", "Night Dresses", "Long Sleeve"] | Yes |
| unit_price | Price of the purchased product without any discount(s) | Float | 100.00 | Yes |
| unit_sale_price | Unit price of the purchased product | Float | 95.20 | Yes |
| url | URL address of the purchased product | String | https://push.useinsider.com/dresses/blue-dress-abc1234 | Yes |
| stock | Stock information of the product that shows the number of products left in stock | Number | 11 | No |
| color | Color of the product selected by the user | String | Blue | No |
| size | Size of the product selected by the user | String | S | No |
| product_image_url | URL address of the product image | String | https://posh.useinsider.com/blue-dress-image | Yes |
| quantity | Number of products | Number | 2 | Yes |
| custom | Custom object that includes custom properties to be collected to Insider database as custom event parameters | Object | {"season": "winter"} | No |
Below, you can find the example script for these two methods of Insider Web SDK.
window.InsiderQueue.push({
type: "add_to_cart", // OR type: "remove_from_cart",
value: {
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"unit_price": 100.00,
"unit_sale_price": 95.20,
"quantity": 2,
"url": "https://posh.useinsider.com/blue-dress",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "https://posh.useinsider.com/blue-dress.png",
"custom": {
"merchandiser": "store123",
"item_finish_date": "2021-01-20T00:00:00Z"
}
}
});Custom events
The type: ‘custom_event' method lets you push custom events to Insider with selected parameters. With this method, you can hit nearly all segmenting and targeting use cases based on your business needs that are not covered via default methods.
While pushing these two events, you must follow the data types of your default custom parameters that you defined on the Attributes and Events page.
Below, you can find the example script for the custom event method of Insider Web SDK. No parameter id required except for event_name.
window.InsiderQueue.push({
type: 'custom_event',
value: [{
event_name: 'name_of_your_custom_event', // as you defined
event_parameters: {
"quantity": 3, // number-typed default parameter,
"custom": {
"domain_group_id": 123, // number-typed custom parameter example
"action_taken": "abc12", // string-typed custom parameter example
"isRepeated": "true", // boolea-typed custom parameter example
"user_acq_time": "2021-01-20T00:00:00Z" // in datetime-typed custom parameter example
}
}
}]
});Configuration for Google Tag Manager
This section provides detailed guidelines for integrating the Insider Web SDK using Google Tag Manager. The principles can be adapted for other tag management systems, as well.
In the table below, you can find all the tags to be created and the settings for correct firing.
| Tag name | Purpose | Included methods/scripts | Triggering (GTM) | Tag sequencing (GTM) |
|---|---|---|---|---|
| Insider - Queue & Core Tag | InsiderQueue array and Insider Tag definition | InsiderQueue and ins.js scripts | All page views | Fire Insider - User Information after this tag |
| Insider - User information | Attribute, currency, and cart items definition | type: 'user', type: 'currency', type: 'cart' | All page views | Fire Insider - Queue & Core Tag before this tag |
| Insider - Home Page | Page type definition | type: 'home' | Home page view |
|
| Insider - Category Page | Page type definition | type: 'category' | Category page view |
|
| Insider - Product Page | Page type definition | type: 'product' | Product page view |
|
| Insider - Cart Page* (not required for tag managers) | Page type definition | type: 'cart' | Cart page view |
|
| Insider - Purchase Page | Page type definition | type: 'purchase' | Purchase page view |
|
| Insider - Other Page | Page type definition | type: 'other' | Other page view |
|
| Insider - Initialization | Data initialization | type: 'init' | None | None |
| Insider - Add to cart | Sends add to cart event | type: 'add_to_cart' | Your trigger | Fire Insider - Initialization before this tag |
| Insider - Remove from cart | Sends remove from cart event | type: 'remove_to_cart' | Your trigger | Fire Insider - Initialization before this tag |
| Insider - Custom Event (for each custom event) | Sends custom event | type: 'custom_event' | Your trigger | Fire Insider - Initialization before this tag |
The user’s cart in the Insider - User Information tag is defined, and the page view will be sent in the Insider - Initialization tag unless another page type is defined before.
If you use the type: 'cart' method in the Insider - User Information tag and don’t want to use the Insider - Cart Page tag, you can skip it. In this case, the Insider - Initialization tag will need a Cart Page View trigger and to be fired after the Insider - User Information tag.