In some implementations of Vinson, Google Ads (previously called Google Adwords) can cause the following error:
"Uncaught TypeError: e.doCallback is not a function"
This error can occur when the following conditions are met:
Google Ads is enabled for a domain.
A customer adds items to their cart and logs out without completing the transaction.
The customer then attempts to log in again.
This error occurs in the Tracker module. To fix the error, you must extend the
prototype object of the
Tracker.prototype.trackEvent() function. For an example of the changes needed for this patch, see EnablingGoogleAdWordsCausesErroronLogin.zip.
Step 1: Extend the Tracker.js File
If you have not done so already, create a directory to store your custom module.
Give this directory a name similar to the module being customized. For example, create
In your new TrackerExtension @1.0.0 directory, create a subdirectory called
Name this file according to best practices. For example:
Open this file and extend the
Tracker.prototype.trackEvent() method as shown in the following code snippet.
, [ 'Singleton'
, function (
Tracker.prototype.trackEvent = function Tracker.prototype.trackEvent (event)
var doCallback = _.find(this.trackers, function (tracker)
return tracker.doCallback && tracker.doCallback();
!doCallback && event.callback();
Save the file.
Step 2: Prepare the Developer Tools For Your Customization
Open your new TrackerExtension@1.0.0 module directory.
Create a file in this directory and name it ns.package.json.
Build the ns.package.json file using the following code:
Open the distro.json file. This is located in your root directory.
Add your custom modules to the
Your code should look similar to the following example:
"name": "SuiteCommerce Advanced Vinson Release",
This ensures that the Gulp tasks include your module when you deploy. In this example, the custom modules are added at the beginning of the list of modules. However, you can add the modules anywhere in the
modules object. The order of precedence in this list does not matter.
TrackerExtension as a dependency to SCA entry point within the
Your distro.js file should look similar to the following:
Save the distro.json file.
Step 3: Test and Deploy Your Customization
Test your source code customizations on a local server (see SCA on a Local Server) or deploy them to your NetSuite account (see Deploy to NetSuite). If you are currently running SCA on a local server, your changes should appear on your local site immediately.
Confirm your results.
Upon successful deployment, enabling Google Ads does not cause errors when a customer logs in or out with items in the cart.