WordPress to Salesforce Bidirectional CRM Integration

Brad Decker

wordpresssalesforceintegrationIntegration projects and integrations in general are a topic that we touch on in a lot of our posts and our readers continue to ask for more. The reason for this demand is due to the sheer number of applications out there that excel in one area but fail to provide us with a complete solution. As a result we end up with our leads in one application, our marketing efforts in another and our website in yet another. Now we have three separate systems that need to work together pretty autonomously. Luckily for us the really great applications out there have API support (what is an API? Learn more here) that allow us to connect multiple systems together. So, with all the different systems and ways of connecting them, we have a constant flow of requests for information on what these integrations are capable of. 

One of the most popular requests for CRM Integration revolves around a powerhouse of an application known as Salesforce. Salesforce is an extremely powerful and flexible CRM that not only allows you to track contacts, leads and customer information - it can also be customized to handle almost any kind of data. We have dealt with a number of customers who have product data stored in Salesforce that allows them to keep an accurate track of their inventory from right within their Salesforce portal, but they may have their actual store hosted on Shopify or another third party ecommerce solution. This means that without a custom integration stock adjustments would have to be made manually inside Salesforce immensely diminishing the value of keeping Products inside Salesforce. 

The Salesforce to WordPress Challenge

Another popular platform for hosting websites is WordPress, and it is one of the most frequent requests we receive for integrations. Recently, we were tasked by one of our clients to build a catalog of its products that were stored in Salesforce and display that catalog on a WordPress website we were to build for them. Because this was a catalog only we didn't have to supply ecommerce functionality (no cart or checkout), which was preferable to the client who wanted to drive leads to their sales team via Salesforce. This project had a number of challenges that we had to overcome but proved to be a feature rich integration that the client was very pleased with.

  • We needed product updates in Salesforce to be immediately visible in the WordPress catalog. 
  • When new products were added to Salesforce they needed to be added to WordPress.
  • When a product was marked as sold in Salesforce, it needed to remain on the website (marked sold) for 14 days to allow customers to view similar products like that one. 
  • The client required an advanced search engine to be able to search and filter through their catalog.
  • A form on each product detail page would feed contact details into HubSpot and via the Salesforce connector would end up back in Salesforce. Product details had to be supplied with the customer's contact details to the HubSpot form for leads to be properly assigned to sales reps.
  • The client required an upload tool that allowed them to upload images directly to WordPress from within the Salesforce portal product pages 

Pushing New Salesforce Records and Updates to WordPress

The first challenge we overcame was handling, essentially, the method by which we were going to retrieve the product data. Salesforce has a robust API that would have allowed us to query for product details directly from the site on each page load without saving anything into WordPress - but at the cost of site load speed and responsiveness. We didn't want to sacrifice user experience for functionality, so we opted to import the product data into WordPress and maintain two records which would then be synced. In order to handle immediately showing changes to products after they are made in Salesforce we created an outbound message and workflow in Salesforce that would send the product details to WordPress so that we could keep the records synced at all times. 

We built a relationship between Salesforce Record IDs and WordPress post IDs in order to know whether a record was an updated record or a new record to avoid duplicate products. This also allowed us to perform a number of custom operations at the time the record is updated or added, including determining whether or not the product was sold and if it was sold if it had been sold within 14 days of the current date. This allowed us to hide products that have been sold for more than 2 weeks and mark products that are recent sales appropriately in the system.

Salesforce Product Search Engine Powered by WordPress

To build the advanced search functionality that the client required we created a couple of custom functions that triggered during the product update or creation action. These functions tagged the products with appropriate keywords and values so that we could leverage the powerful WordPress search engine to find and display product search results easily. We did this by using custom taxonomies within WordPress for each type of filter that the client requested for their visitors to have at their disposal. This saved a great deal of computing power over the alternative of building a Salesforce API call for each combination of filters and search values.

Sending WordPress Website Leads Through Salesforce

A crucial part of our clients sales process was getting their leads into Salesforce so that they could be automatically assigned to a sales rep. However we wanted to also help the client to utlize the power of HubSpot as well so we relied on the Salesforce HubSpot connector to push form submissions through to Salesforce. We created a custom HubSpot form that accepted the Salesforce Record ID as a field so that when leads came through HubSpot into Salesforce the system would know how to assign the lead. This allowed the client to track interest in products not only in Salesforce but also in HubSpot where they could see the number of visits to their product page in relation to the number of form submission on that page. Highly useful tools to have for marketing and product optimization!

Handling WordPress Product Image Upload from within Salesforce

Building out a tool for the client to upload product images to WordPress from a Salesforce product record and have them automatically associated with the correct product within WordPress proved to be a fun challenge. Using custom s-controls we were able to build a upload mechanism that was hosted in wordpress but was added to the product pages via a frame that allowed the images uploaded to it to be automatically associated with the proper product. We even provided the client with tools for selecting the primary image, deleting images, and also clicking through the images to find the end URL for report building and quote generation. We also were able to transfer all of the images already associated with the products that resided on a windows server (the old website) without data loss!

The Final Result: A Fully Integrated Salesforce Product Catalog

WordPress excels at displaying dynamic data and after fully integrating Salesforce we now have a robust, user experience rich website that allows our client's customers to quickly and easily filter through products and find what is right for them. Our client have frequently come back to us with ideas for how to improve lead conversion rates by manipulating the Salesforce data as it comes into WordPress, like adding a hot deal sticker to products that have recently dropped in price. Once you have the data connected adding little customizations to the way that data is processed is easy and gives our clients who use Salesforce a lot of power in controlling exactly what they want the end user experience to be. 

If you are interested in Salesforce integration with WordPress or any other system do not hestitate to reach out to our team. We have lots of experience working with the Salesforce API and all that it has to offer!

Guide to Hiring a Web Design Agency

Photo Credit: zedworks via Compfight cc

Inbound Marketing Tools

Brad Decker

Posted By: Brad Decker

Brad is a Web Engineer whose passions include web development, gaming and writing. He enjoys a challenge and does not understand the meaning of the word "can't".