Looking for some assistance… How do you use the `a...
# suitecommerce
c
Looking for some assistance… How do you use the
addTracker( Tracker )
method to push additional data to Google Tag Manager? How would I adjust the example from the help guide? https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/Environment.html#addTracker
Copy code
var myTracker = {
	trackAddToCart: function(line) {
		_exampleTrackingService.logShoppingEvent(
			'addToCart',
			{
				name: line.item.displayname,
				sku: line.item.itemid,
				amount: line.amount,
				quantity: line.quantity
			}
		);
	}
}
Looking to extend trackTransaction for Google Tag Manager. Should I use the API linked to my previous post or can we extend trackTransaction as we have for previous versions?
c
@Christopher Dembek Iirc,
afterSubmit
fires after the order is successfully placed in NS, but before the GTM
trackTransaction
method fires. You should be able to place extra stuff in the
dataLayer
variable and then handle in however you want from GTM.
👍🏻 1