If you encounter issues with shopping cart integration there are troubleshooting steps you can take to fix the problem.
This article will detail basic troubleshooting when integrating a shopping cart.
Article Contents
Trial | ||
Essential | ✓ | |
Advanced | ✓ | |
Ultimate | ✓ |
Administrators | ✓ | |
Company Managers | ||
Marketing Managers | ||
Sales Managers | ||
Salespersons | ||
Jr. Salespersons |
Basic Requirements
In order to troubleshoot a shopping cart, do the following:
- Request credentials for a partner's shopping cart.
- Provide a test product for $0 with $0 cost for shipping. If you are unable to provide a $0 product, provide a test credit card number or a test mode link to bypass actual payment details.
- Verify their implementation includes Lead Gen & CRM page tracking code in the head of all pages of the cart.
- Verify the first thing triggered is the following call:
_setTransaction
Questions for _setTransaction Calls
Q: Which fields are required in_setTransaction?
A: All fields are required, with the exception of firstName
, lastName
, and emailAddress
.
Q: If I do not know the total, tax, or shipping, can I leave it blank or null?
A. No. Use '0.00'
if it is not known yet. You can and should run _setTransaction
any time you have additional information or wish to update the totals.
Q: Is 'transactionID' the same as the order number?
A: It can be. The only requirement is that it is a unique number used for all three API calls. It can not change in the middle of the process. If your shopping cart can generate a unique order number right from the start, use it. But, if not, it must be some other number generated on your side to represent the transaction that cannot change.
Q: Is 'storeName' a value I should be getting from somewhere?
A: No, this is only used to store in Lead Gen & CRM's system and is not a key of any kind. This should be a human-readable, friendly label for your store. An example would be 'Fruits and Nuts Shoppe'
.
Q: Why am I running _setTransaction if I do not know any details yet, like a final order total?
A: This must be run first so that Lead Gen & CRM can establish the transactionID
for the potential order. You may run _set Transaction
during other steps to update the final order total (such as when someone adds a product to a cart, or finalizes their purchase). It should be run multiple times during the process.
Questions for _addTransactionItem Calls
Q: Which fields are required in _addTransactionItem?
A: All fields are required. This may not contain any “$”
or null or blank values.
Questions for _completeTransaction Calls
Q. When should I run _completeTransaction?
A. This should be the final call in code after the person checks out or otherwise pays, so it should be placed on the receipt page or final order confirmation page. It may be a good idea to rerun _setTransaction
prior to _completeTransaction
to ensure the final totals have been sent to Lead Gen & CRM.
Q: What transactionID should be used?
A: This should use the same transactionID
that has been used in the other two calls. Even if an order number has been generated by the cart, you must not use that and continue to use the “Transaction”
number used throughout the process. Consider the following:'transactionID': '1234', (should be the same value used in _setTransaction call)
Additional Questions
Q: When is the shopping cart unavailable?
A: The shopping cart is unavailable when a Salesforce Sync is active.
Q: What if the checkout page is hosted on another domain, subdomain, or it changes completely?
A: All pages during the process including the final order confirmation page must be trackable within Lead Gen & CRM. It is fine if it changes, but you must do the following:
- Set up each site in Lead Gen & CRM as a trackable site
- Put the tracking code in the header HTML
- Have the ability to generate the API Javascript calls
Additionally, the domain must be static. It can not be some randomly generated subdomain that you do not know in advance. This is because you must add the full domain as a trackable site inside of Lead Gen & CRM.
Example Code
The following is example code for integration:
<script type='text/javascript'>
_ss.push(['_setTransaction', {
'transactionID': '1234',
'storeName': 'My Store',
'total': '100.00',
'tax': '4.32',
'shipping': '8.00',
'city': 'Gainesville',
'state': 'Florida',
'zipcode': '32601',
'country': 'USA' }]);
</script>
<script type='text/javascript'>
_ss.push(['_addTransactionItem', {
'transactionID': '1234',
'itemCode': 'DD44',
'price': '11.99',
'quantity': '1'
'productName': 'TShirt',
'category': 'Olive Medium' }]);
</script>
<script type='text/javascript'>
_ss.push(['_completeTransaction', {
'transactionID': '1234' }]);
</script>