GUA in SuiteCommerce

This topic applies to

Applies to

SuiteCommerce Web Stores

The procedure for implementing Google Universal Analytics on your SuiteCommerce web store requires you to set specific configuration information regarding your Google Universal Analytics account. If you are using 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 SuiteCommerce 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 the help topic Working with Google Analytics.


To enable Google Universal Analytics:

  1. Select the domain to configure at Setup > SuiteCommerce Advanced > Configuration.

  2. In the SuiteCommerce Configuration record, navigate to the Integrations tab and the Google Universal Analytics Subtab.

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

  4. Save the Configuration record.

To enable Google Universal Analytics (pre-Vinson):

The following procedure should be performed on a custom ShoppingApplication, custom CheckoutApplication, or custom MyAccountApplication module in your local source files. See Customize and Extend Core SuiteCommerce Advanced Modules for information on creating a custom module.

  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 Customize and Extend Core SuiteCommerce Advanced Modules 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 on 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
                   });
                }