Lead Gen & CRM's Shopping Cart Integration allows you to automatically record web transactions from your online store and attribute those sales to Lead Gen & CRM Campaigns.
This enables you to measure your end-to-end marketing ROI for eCommerce-based businesses.
This article will provide an overview on shopping carts.
Accessing the Shopping Cart
The Shopping Cart feature allows you to measure which campaigns are creating the most online transactions, providing you with a way to make better marketing decisions.
Note: Shopping Cart is not available when Salesforce Sync is active.
After integrating a shopping cart and running at least one transaction, the Cart page will become accessible. This page is where you can access information for all of your online transactions. Click Connections > eCommerce in the left toolbar to access the Shopping Cart.
Understanding the Shopping Cart
The Shopping Cart page displays all of your recent transactions, as well as any historical transactions, and includes information on:
- The name and email address of the purchasing lead
- When the transaction occurred
- The details of items sold during the transaction
- The total purchase value
Clicking on either the total number or the product icon will display the details for that transaction.
If a lead completes a web transaction and is associated with a Lead Gen & CRM campaign, you will see their sales attributed back to that individual marketing tactic on the Campaign Insights page.
Setting Embedded Code
In order to record your eCommerce transactions as Closed Won Opportunities in Lead Gen & CRM, you will need to be familiar with the three calls that go after (or are executed after) your embedded code.
The process for tracking eCommerce through Lead Gen & CRM is dictated by these three calls. They are described below in the order in which you should insert them within your shopping cart or eCommerce software.
Note: Constant Contact offers Professional Services to assist with custom coding.
Creating Transaction Objects
_setTransaction method to initialize a transaction object. The transaction object stores all the related information about a single transaction, such as the transaction ID, shipping charges, and billing address. This information is all pulled from the transaction ID, which will be the same value for a given transaction and all items associated with it.
In the event that an email address is supplied as part of the
_setTransaction payload, a lookup will be performed to determine if a matching record is available for that email address. If a matching record is located, the record's data may be optionally updated by supplying an additional
If a matching record is not located for a supplied email address, a new record will be created automatically and may optionally be populated with any
lastName data that is supplied. Regardless of whether an update or creation event results from including an email address in the payload, the user's tracking cookie will automatically associate with the email address supplied, and any subsequent transactions will be associated with the appropriate contact record.
Adding Items to Transactions
_addTransactionItem method tracks information about each individual item in the user's shopping cart and associates the item with each transaction via the transactionId field. This method tracks the details about a particular item, such as SKU, price, category, and quantity.
_completeTransaction method confirms that a purchase has occurred, and all data that has been built up in the transaction object is finalized as a transaction and saved as a closed opportunity.
Example Shopping Cart Code
The following is an example of basic embedded code.
The following example code reflects what complete shopping cart code looks like. This code should go after embedded code. Shopping cart code can only be placed on tracked pages.
'storeName': '*** Acme Test Co. ***',
'city': 'San Jose',
// the following params can be used for creating/updating
// a contact in the context of the supplied transaction data.
// if this data is omitted, the underlying contact/tracking data
// associated with the visitors browser session is used automatically.
'firstName' : 'John', // optional parameter
'lastName' : 'Smith', // optional parameter
'emailAddress' : 'firstname.lastname@example.org', // optional parameter
'cartUrl': 'https://www.shopify.com/your/cart' // optional parameter
'category': 'Olive Medium',
'productURL': 'https://yourcompany.com/olivemedium/tshirt', // optional parameter
'imagePath' : 'https://yourcompany.com/olivemedium/tshirt.png' // optional parameter