Today, building a website often includes integrating with a variety of third-party services ranging from external databases, CRMs, Ecommerce, Video Services, Analytics, to whatever else your project demands. While AgilityCMS (Content Manager) does have several built-in integrations such as Google Analytics, and YouTube, the true power is in the hands of you, the developer.
This article serves as a guide on how you can build integrations into your AgilityCMS instance and website.
There are two types of integrations:
- Content Manager Integrations - this includes developing custom fields connecting to data sources, and firing workflow events
Content Manager Integrations
The Content Manager provides several different integration points:
- Webhooks - Webhooks are a critical part of Agility Ecommerce (an extension of AgilityCMS). Webhooks allow Ecommerce to notify other systems of updates to Customers, Orders, Shipment, Returns, and Subscriptions. This can be used to sync info from Ecommerce to services such as CRMs and Warehouse services.
AgilityCMS is completely decoupled from your Website code base on ASP.NET MVC with only a single required dependency on Agility.Web (available on nuget). This means there's no limitations to what you can do in our MVC project. You can take advantage of wealth of .NET support for integrations. Want to connect to SalesForce? There's an app for that. Want to connect to Microsoft Dynamics? There's an app for that too.
A common use case is combining Content Manager and Website Integrations by building your own API to provide data to your custom input fields in AgilityCMS or to provide a validation hook that you want validate server-side and return a response to an AgilityCMS Custom Event.
Here's a few examples of some awesome integrations developers have come up with - just to get the juices flowing:
Custom Field for Selecting Database Records
A module has been developed that displays a listing of featured items that is sourced from an external database. The editor would like to be able to control exactly which of those items are displayed on the website.
A solution to this, was to create a Custom Field Type via JS that renders a "searchlistbox" (search based on input and select) that uses AJAX and CORS to return a list of results from that external database. Now editors, are actually selecting real records from their database, saving the ID of the record on save and then in the module code, a database query is executed to retrieve those details.
A list of "Products" is maintained with AgilityCMS. Each product has a SKU field. The SKU field is used later to map and synchronize data with Microsoft Dynamics. It is imperative that the editor sets a valid SKU when they save a product in Agility.
A solution to this was to validate the SKU on the onBeforeSave event using the Custom Events JS API. A controller action result was setup on the website to accept a SKU parameter and query Dynamics to see if that SKU exists and is active. Then, in AgilityCMS every time a Product is saved, the onBeforeSave event is called which executes a JS function. Code was implemented in the function to call the Dynamics SKU validation controller action via AJAX and CORS and await a response. If the SKU was valid, the Save was allowed to continue. If it wasn't valid, the save would be cancelled and the user was prompted to enter a valid SKU.
The following list represents just some of the services we've integrated with over the years:
- Google Analytics
- Azure Application Insights
- Survey Monkey
- Constant Contact
- Mail Chimp
- Google Site Search
- Azure Cognitive Services
- Microsoft Dynamics
- SCI Warehousing
- Smart Warehousing
- Dare Marketing
- Google Double-click for Publishers
- Order Dynamics
Are you working on an integration and thinking about the best way to tackle it? We'd love to hear from you and offer some guidance. Please contact us and we'd be happy to help!