Developer Tip: Using the API to Sync Opt-Ins When Using Cart Recovery

Eric Hirsh, Senior Sales Engineer

Eric Hirsh, Senior Sales Engineer

TL;DR: If you are using Bronto’s Cart Recovery on your website, be sure you’re correctly importing your email opt-ins to help preserve the integrity of your list.

A Little Background: How Does Cart Recovery Work?

From the marketer’s perspective, Bronto’s Cart Recovery app is a powerful tool for recapturing revenue from orders that shoppers might have otherwise abandoned. Its technology is quite robust, and our team of engineers has put a lot of work into making our cart-tracking service accurate and scalable. At a high level, its job is two-fold.

  1. It tracks the creation and modification of shopping carts as a user progresses throughout a site visit to understand whether the cart becomes a completed order or an abandoned cart.
  2. It identifies (via email address) as many shoppers as possible, which helps you determine which abandoned carts are still reachable.

To accomplish the latter, the app identifies “Email Capture Points” – all of the possible places on your website where someone can enter an email address: a newsletter sign-up in the footer, the account login page, contact information given during checkout and so forth. During implementation, a Bronto professional services engineer will work with you to identify all of these capture points, get the jQuery selector for each of these input fields and configure the app to listen for any inputs.

With this process, Bronto captures a LOT of email addresses from your site and immediately creates contact records inside of the Bronto Marketing Platform. But don’t worry – we aren’t automatically denoting these new records as having signed up to receive your email marketing. That would go against our own Permission Policy, which is why we use status attributes. A status of Onboarding or Active means that the contact has given permission to receive marketing emails, while a status of Transactional means that the contact exists in the database only for record-keeping purposes and will only receive communications such as order confirmations.

What Does This Mean for Your Contacts Integration?

If you only sync email opt-ins to Bronto using our “Direct Add” pixel, then you needn’t read further. But if you use the API or Data Loader (our FTP solution which we built using our own API) to add or update contact records in Bronto, you need to consider the following:

Normally, you’d use Bronto’s addOrUpdateContacts API call (or configure the Data Loader job Import Action to “Add or Update”) to both add new contact records into Bronto and update existing ones, such as adding a first name where a value did not exist previously. But what if you capture a sign-up event and use this API call to pass what you think is a new record into Bronto? That contact record might very well already exist with a status of Transactional because the cart recovery service picked it up earlier in the web session.

The addOrUpdateContacts API call does not have the power to change the permission status of an existing contact, as in from Transactional to Onboarding or from Active to Unsubscribed. Only the updateContacts API call (or configuring a Data Loader job to “Update Contacts”) can do that. When syncing contact data, it’s best to first readContacts to see if an email address already exists in Bronto, and then conditionally proceed with addOrUpdateContacts or updateContacts, depending on the result of that query. You can find more on this process in the addOrUpdateContacts documentation and in this helpful tutorial on syncing contact data with Bronto.

If you don’t include this in your code, you run the risk of collecting email sign-ups that are never properly flagged in Bronto, which means they’ll never receive any marketing messages. If and when you finally realize this, it may be too late to reach out to these people again. Based on deliverability best practices, the moment is gone. What a missed opportunity! But by adopting this development best practice, you can rest easy knowing your list will continue to grow as it should.

*Bronto’s Browse Recovery app accomplishes a very similar feat around email capture. The integration practices outlined above apply to it as well.