GUA in Commerce Web Stores

Important:

Google Analytics 4 (GA4) has replaced Google Universal Analytics (GAU) as Google’s cross-platform Analytics solution. All standard GUA properties stopped processing new hits on July 1, 2023. 360 Universal Analytics properties will stop processing new hits on July 1, 2024. See Google Analytics 4 for information about GA4, including information about migrating from GUA to GA4.

The procedure for implementing Google Universal Analytics on your Commerce web store requires you to set specific configuration information regarding your Google Universal Analytics account. If you use Google Adwords, you must also set the conversion tracking ID, label, and value.

For configuration information see Configure Properties.

Important:

Settings on the Analytics tab in the Web Site Set Up page are not used when enabling Google Universal Analytics for Commerce web stores. Only the configuration settings as described in this topic are used. For details on how to implement Google Universal Analytics for Site Builder sites, see Working with Google Analytics.

To enable Google Universal Analytics:

  1. Select the domain to configure at Commerce > Websites > Configuration.

  2. In the configuration record, go to the Integrations tab and the Google Universal Analytics subtab.

  3. Set feature properties as required. For more information about each configurable property, see Google Universal Analytics Subtab.

  4. Click Save.

Enable Google Universal Analytics (pre-Vinson)

This information refers to the Denali and Mont Blanc releases of SuiteCommerce Advanced only.

The following procedure should be performed on a custom ShoppingApplication, custom CheckoutApplication, or custom MyAccountApplication module in your local source files. See Develop Your SCA Customization for information about creating a custom module.

To enable Google Universal Analytics (pre-Vinson):

  1. Create a custom module that includes the SC.Shopping.Configuration, SC.MyAccount.Configuration, or SC.Checkout.Configuration object as a dependency.

    Note:

    Do not edit the original source files directly. See Develop Your SCA Customization for information and best practices on customizing JavaScript.

  2. Extend the googleUniversalAnalytics object to set the propertyID, value, and domainName.

                               googleUniversalAnalytics: {
                propertyID: ''
             ,   domainName: ''
             } 
    
                    
    Note:

    For more information about these properties, see Google Universal Analytics Subtab.

  3. For the propertyID, enter the Tracking ID for the property in your Google Analytics account.

    To locate the tracking ID, login to your Google Analytics account and go to Admin > Property > Property Settings.

  4. For the domainName enter one of the following, depending on the custom module you are configuring:

    • ShoppingApplication: enter the domain name of your site.

    • CheckoutApplication and MyAccountApplication: This is normally checkout.netsuite.com or checkoutna1.netsuite.com. You can see which checkout domain your site uses on the Setup subtab of the web site setup record. The CheckoutURL field lists the checkout domain.

    • If you have your own SSL certificate running under a subdomain, use that as the value for the domain name.

    The resultant code should be similar to the following:

                      tracking: {
             // [Google Universal Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
             googleUniversalAnalytics: {
                propertyID: 'UA-12345678-1'
             ,   domainName: 'mynetsuitesite.com'
             } 
    
                    
  5. Optionally, enable additional tracking.

    By default, the trackPageview function is used. In addition to tracking page views you can enable tracking of events. To enable event tracking set the propertyID and domainName.

                      tracking: {
             // [Google Universal Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
             googleUniversalAnalytics: {
                propertyID: 'UA-12345678-1'
             ,   domainName: 'mynetsuitesite.com'
             } 
    
                    

    The trackEvent function in the Google Universal Analytics module defines several user events that can be tracked.

                      trackEvent: function (event)
             {
                if (event && event.category && event.action)
                {
                   // [Event Tracking](https://developers.google.com/analytics/devguides/collection/analyticsjs/events#implementation)
                   win[name]('send', 'event', event.category, event.action, event.label, parseFloat(event.value) || 0, {
                      'hitCallback': event.callback
                   });
                } 
    
                    

Related Topics

GUA for Site Builder with Site Builder Extensions

General Notices