SuiteCommerce Analytics Data and Cookie Consent Integration
SuiteCommerce Analytics Data enables tracking of shopper behavior. This requires a cookie consent extension for user preferences.
The SuiteCommerce Analytics Data feature allows you to track and measure user behavior and navigation on a SuiteCommerce website. To utilize this feature effectively, certain prerequisites must be met. Importantly, you need to enable the feature in your NetSuite account and install the SuiteCommerce cookie consent extension. This extension provides a mechanism for shoppers to manage their consent regarding the use of tracking and analytics cookies on your SuiteCommerce site. Additionally, if you seek a different user experience or additional functionality, custom extensions can be created using the available methods in the extensibility API.
Prerequisites
To successfully implement SuiteCommerce Analytics Data, ensure the following prerequisites are satisfied:
-
SuiteCommerce Analytics Data must be installed in your account to manage analytical data related to shopper navigation and behavior. For more information, refer to the SuiteCommerce Analytics Data Overview.
-
Application Performance Management for SuiteCommerce (SC APM) SuiteApp must also be installed. APM enables you to measure application performance and speed, while registering application actions in NetSuite. Details on this can be found in Application Performance Management (APM) for Commerce.
Creating Extension Files
You will create a baseline extension that establishes the necessary file structure for your extension:
1MyCookiesExtension2 \Modules3 \MainModule4 \JavaScript5 NetSuite.MyCookiesExtension.MainModule.js6 NetSuite.MyCookiesExtension.Banner.View.js7 NetSuite.MyCookiesExtension.Footer.View.js8 \Templates9 netsuite_mycookiesextension_banner.tpl10 netsuite_mycookiesextension_footer.tplThe following table details the purpose of each file:
| File | Description |
|---|---|
| NetSuite.MyCookiesExtension.MainModule.js | Entry point file for the extension, instantiating SuiteCommerce API components and loading views. |
| NetSuite.MyCookiesExtension.Banner.View.js | Displays a form for website visitors to set cookie preferences above the website header. |
| NetSuite.MyCookiesExtension.Footer.View.js | Shows a link for visitors to open the cookie banner in the footer of the website. |
| netsuite_mycookiesextension_banner.tpl | Template file for the banner view. |
| netsuite_mycookiesextension_footer.tpl | Template file for the footer view. |
Updating the Entry Point File
In the entry point file, instantiate the Layout component to display the banner and footer views. The UserProfile component must also be instantiated and passed to the banner view:
1"text-purple-400">define(2 'NetSuite.MyCookiesExtension.MainModule', 3 [4 'NetSuite.MyCookiesExtension.Banner.View',5 'NetSuite.MyCookiesExtension.Footer.View'6 ], 7 "text-purple-400">function (MyCookiesExtensionBannerView, MyCookiesExtensionFooterView) {8 'use strict';9 10 "text-purple-400">return {11 mountToApp: "text-purple-400">function mountToApp (container)12 {13 "text-purple-400">var layout = container.getComponent('Layout');14 "text-purple-400">var userProfile = container.getComponent('UserProfile');15 16 "text-purple-400">if (layout) {17 layout.addChildView('Header', "text-purple-400">function() {18 "text-purple-400">return "text-purple-400">new MyCookiesExtensionBannerView({userProfile: userProfile});19 });20 21 layout.addChildView('Footer', "text-purple-400">function() {22 "text-purple-400">return "text-purple-400">new MyCookiesExtensionFooterView();23 })24 }25 }26 };27});To properly reference user preferences, the getBrowserConsentCookie() function is used to check for the existence of the consent cookie defined as 'trackingConsentCookie'. The cookie's value is a Base64-encoded string.
Persisting Cookie Preferences in NetSuite
To save the visitor's cookie consent preferences in NetSuite, create a function called setCookiePreferences() that takes in two parameters: the preferences object and the Base64-encoded string. Use the setCookieOptions() method from the UserProfile component to store the visitor preferences. This method requires a secure connection (HTTPS) and that the user is logged in.
1MyCookiesExtensionBannerView.prototype.setCookiePreferences = "text-purple-400">function(cookieOptions, browserCookieValue) {2 "text-purple-400">this.userProfile.setCookieOptions(cookieOptions.consentSettings).then("text-purple-400">function(result) {3 console.log('setCookieOptions was successful.'); 4 })."text-purple-400">catch("text-purple-400">function() {5 console.log('setCookieOptions failed.');6 }).always("text-purple-400">function() {7 document.cookie = "trackingConsentCookie=" + browserCookieValue;8 });9}Implementing this feature will help you better understand and serve your customers while complying with legal requirements regarding cookie consent.
Key Components
- User Consent Management: The extension allows users to manage their consent for data tracking to ensure compliance with regulations.
- Modular Structure: The extension is structured in a modular fashion, allowing for easy updates and customizations.
- Flexible Implementation: Developers can create custom extensions as needed using the extensibility API.
Conclusion
Incorporating the SuiteCommerce Analytics Data feature alongside the cookie consent extension is essential for eCommerce businesses looking to optimize their tracking and improve user trust. It ensures that users have control over their data collection and analysis while providing critical insights into customer behavior.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- SuiteCommerce Analytics Data allows for the tracking of user behavior on eCommerce sites.
- Installation of a cookie consent extension is crucial for managing user consent.
- Developers can create custom extensions for enhanced functionality using the extensibility API.
Frequently Asked Questions (4)
What prerequisites must be met to implement SuiteCommerce Analytics Data?
Is it necessary to develop custom extensions for the SuiteCommerce Analytics Data feature?
How do you persist cookie preferences in NetSuite?
What does the SuiteCommerce cookie consent extension do?
Was this article helpful?
More in Commerce
- Available Items Only Feature in NetSuite 2026.1
Available items only filtering boosts sales efficiency in NetSuite 2026.1 with Intelligent Item Recommendations.
- Commerce Extensions in NetSuite 2026.1
Commerce Extensions in NetSuite 2026.1 enhance performance and user experience in eCommerce.
- Convert Multiple Transaction Line Items into Configured Items in
Enhance transaction processing in NetSuite by converting multiple line items into configured items with improved session handling.
- New SuiteCommerce Features in NetSuite 2026.1
New SuiteCommerce features in NetSuite 2026.1 enhance user experience and improve eCommerce efficiency.
