Search Results

wpf_user_imported

This action is triggered whenever a new user is imported from your CRM (usually via a webhook), and after the user account has been created. Parameters $user_id: The user ID of the newly created user $user_meta: The meta data imported with the new user Examples Send a welcome email The example below will send a welcome […]

Read More

MemberPress

[…] Fusion provides a bi-drectional integration between MemberPress and any one of 50+ supported CRMs and marketing automation systems. When a user checks out on your MemberPress site, their contact details will automatically be added to your CRM of choice, including support for custom fields. WP Fusion also supports applying tags in your CRM based […]

Read More

HubSpot Custom Objects

In addition to supporting custom objects with Zoho, Salesforce, and Ontraport via the wpf_crm_object_type filter and the add_object() method, WP Fusion supports adding and updating custom objects with HubSpot. For a video walkthrough of custom objects, check out Data in HubSpot: Custom Objects and Other Tools in HubSpot’s Academy. For additional information and examples please […]

Read More

Salesforce Tags

[…] you have four options for segmenting contact records with WP Fusion: Topics Picklist Personal tags Public tags You can select which method you’d like to use from the Segment Type setting on the Setup tab, after configuring your connection to Salesforce. After changing the segment type, save the settings to update the available options in […]

Read More

ConvertKit Webhooks

[…] your WordPress site when tags are applied in ConvertKit, or update existing users’ meta data and tags. WP Fusion supports two types of webhooks: update and add. The update webhook will trigger WP Fusion to load the user’s latest meta data and tags from ConvertKit. Using the add webhook will create a new WordPress […]

Read More

MailerLite Webhooks

[…] a certain group, or automatically update existing users’ meta data and groups when changes happen in MailerLite. Having trouble receiving webhooks? Check out our troubleshooting guide. Setup The “update” method is very straightforward: check the checkbox next to Update Trigger, and any updates to subscribers in MailerLite will automatically be synced back to WordPress. This […]

Read More

ActiveCampaign Abandoned Cart Tracking

Using WP Fusion you can track abandoned carts in WooCommerce, Easy Digital Downloads, MemberPress, and other WordPress plugins, and follow up on them in ActiveCampaign. There are two ways to do this, either via ActiveCampaign’s Deep Data API (Plus plans and higher), or using the older tag-based method. Deep Data API The Deep Data […]

Read More

Gravity Forms

[…] Forms to send new form submissions to any one of 40+ CRMs and marketing automation tools, allowing you to track and engage with leads. It also supports the Gravity Forms User Registration Add-on for user registrations. Setup First create a form in Gravity Forms and save it. Then you’ll be able to access the […]

Read More

Abandoned Cart Tracking Overview

WP Fusion’s Abandoned Cart addon works with: WooCommerce Easy Digital Downloads LifterLMS and MemberPress to automatically add customers to your CRM when they begin checking out on your store. After the customer’s name and email have been entered on the checkout form, the customer is added as a contact to your CRM (even if […]

Read More

wpf_user_update

This filter allows you to modify user meta data before it’s sent to your CRM. To use the code examples below, add them to your active theme’s functions.php file. Parameters $user_meta: Array of user meta data, in the format array(‘meta_field’ => ‘value’). $user_id: ID for the user being updated. Examples Save the full URL to a user’s profile photo If you’re using Ultimate Member to run your site’s membership platform, and want to save a link to the user’s […]

Read More

Activity Logs

WP Fusion includes a logging tool, which you can enable from the Advanced tab of the options page. There are three options: Enable Logging: This is the default level of logging for WP Fusion. It’s on by default but can be turned off. Only Errors: With this checked, only error level messages (like API errors or timeouts) will be recorded to the logs. HTTP API Logging: With most CRMs, WP Fusion utilizes the WordPress HTTP API for API calls. If this setting is available you can turn it on and log the raw API requests and responses from your CRM. Note that this will add a lot of extra data to your logs so it’s recommended to only turn this on temporarily for debugging purposes. When the logs are enabled, you’ll see a new tab appear at the top of the WP Fusion settings page with a link to the activity logs. The logs can also be accessed in the main WordPress admin menu under Tools » WP Fusion Logs. The logs The activity log will record any API calls sent by WP Fusion, as well as any webhooks received and auto-enrollments that are triggered. You can filter the log entries by severity level, source (plugin integration), and related user by using the dropdowns at the top. You can adjust the number of entries displayed per page by opening the Screen Options panel at the top of the table. You can link to individual log entries by hovering over the entry row and clicking the blue link icon. Linking to log entries is helpful when submitting a support ticket. Field formatting When setting up the field sync between WordPress and your CRM in the Contact Fields settings, WP Fusion gives you the option to select a field type for each field. If a special field type is selected, then the data for that field will pass through a filter before being sent to your connected CRM. For example many CRMs have require special treatment for date fields, they require the fields to be in a timestamp, and so when a field type is set to “date”, WP Fusion converts the value automatically for you. In cases where a field value has been modified, the logs will show both the input data and the data that was sent to your CRM. This can be useful in troubleshooting issues with specific fields not syncing correctly. Errors The logs will also record any API errors encountered. These will vary depending on your connected CRM, but can be caused by several things— like trying to apply a tag that’s been deleted, API quotas exceeded, or malformed data. If you encounter an error in the logs that you don’t understand, please contact our support team so we can resolve the issue for you. Error notifications You may want to receive notifications when WP Fusion has an API error. If so, check out our other plugin, Fatal Error Notify. It can automatically send you an email or ping you on Slack when WP Fusion has an API error. The Fatal Error Notify plugin can ping you on Slack when WP Fusion encounters an API error The notification will include the error message, the affected user, and the page the user was on. HTTP API logging With HTTP API Logging enabled, WP Fusion will log the raw requests and responses to your CRM over the WordPress HTTP API. This can be used to troubleshoot more complex issues that aren’t captured at the normal level of logging. HTTP API logging records the raw HTTP requests and responses from your CRM. Every API call sent to your CRM will be recorded, and each entry will contain the request URL, the time it took to perform the API call, the request parameters, and the raw response. Common Errors These are some common errors, with steps to resolve them: Notice: Webhook received but no matching user found When you’re using a webhook with the method ?wpf_action=update or ?wpf_action=update_tags, WP Fusion will only load data from your CRM if there is already a user on your site with a matching contact ID. If there is no user with a matching contact ID, the webhook will be ignored. This is intended for cases where you have contacts in your CRM that don’t need to have an account in WordPress, and is generally safe to ignore. However if you need every contact in your CRM to have a user account, you can change your webhook to ?wpf_action=add, which will both update existing users and create new users if they don’t already exist. Notice: No contact ID for user, failed to apply tags This message is triggered when a plugin integration attempts to apply a tag (for example due to a checkout, page view, or membership level change), but WP Fusion was unable to find a contact ID in your CRM for the user. This could happen because you’ve deleted or merged contacts in your CRM, and so the contact ID that was previously associated with the user has changed. If that’s the case, run a Resync Contact IDs and Tags operation from the Advanced tab in the WP Fusion settings to refresh the cache of contact IDs. It could also happen if a user wasn’t synced properly to your CRM at registration— either due to an API error, or that user’s role being excluded from sync. In that case you can run an Export Users batch operation. It’s also perfectly fine to ignore this notice if the user in question doesn’t need to be tagged in your CRM. Notice: Unable to determine tag ID from tag name This notice can be logged when you’re applying a tag via AJAX, either via link click tracking, or the Media Tools addon. In order to send the API call to apply a tag in your CRM, WP Fusion needs to know the ID of the tag to be applied. WP Fusion will attempt to take the tag name you’ve entered and convert it to a tag ID, but if it can’t find a matching tag ID then this message will be logged and the tag won’t be applied. If you’re sure the tag name you’ve entered matches exactly the tag name in your CRM, try clicking Resynchronize Available Tags & Fields from the Setup tab in the WP Fusion settings to refresh the cache of available tags. Error: Resource not found / contact not found / 404 For performance reasons WP Fusion keeps a cache of the CRM contact ID for every user on your site. When WP Fusion goes to update a contact record or apply tags over the API, it uses this cached contact ID rather than having to look up the contact record again by email address. However, if you have deleted, merged, or de-duplicated contact records in your CRM, the cached contact ID may no longer be valid, and API calls to update contacts or apply tags might return a Resource not found error. The best way to fix this is to run a Resync Contact IDs operation from the Advanced tab in the WP Fusion settings. This will re-lookup every WordPress user on your site by email address in your CRM and refresh the local cache of contact IDs. Error: cURL error 28 — Operation timed out Most API calls WP Fusion sends to your CRM should complete within 0.5 to 2 seconds. However there are situations where your CRM’s API may be offline, in which case WP Fusion includes a built in timeout to avoid breaking the visitor experience on your site. This timeout is set to between 10 and 30 seconds depending on your connected CRM. If this timeout is reached WP Fusion will give up on waiting for a response from your CRM, a cURL error 28 error will be logged, and the page will continue to load normally. When your CRMs API comes back online you may want to run one or more batch operations to correct for any data that wasn’t synced or tags that weren’t applied during the outage. If the problem is happening consistently, you could consider using a code snippet to extend the HTTP API timeout for your site. We have an example here. System Errors To aid in troubleshooting, the activity logs will also record two types of system errors. While these don’t necessarily come from WP Fusion, they can affect the stability of your website as whole. Those error types are: Out of memory errors An “Allowed memory size exceeded” error occurs when your site runs out of available memory and stops processing a page load. This can be caused by underpowered hosting, or having too many plugins active. If an out of memory error happens before WP Fusion has sent data to your CRM, this would prevent any data from being synced. Read some info on fixing this error at WPBeginner. Maximum execution time exceeded errors Most websites will process a single page load for 30 seconds before timing out, and triggering a “Maximum execution time exceeded” error. As an example, let’s say you have several WooCommerce extensions active, and a single checkout does the following: Creates a new WordPress user Sends the order invoice data to Xero Sends the order shipping information to ShipStation Generates a PDF invoice Syncs the customer data to ActiveCampaign (via WP Fusion) Each of these steps takes a few seconds to process. If your site reaches the 30 second timeout limit while it’s still generating the PDF invoice, then this would prevent WP Fusion from sending any data to your CRM. Preventing these errors involves either increasing your server resources (so each step processes faster), deactivating some plugins (so there are fewer steps to process), or increasing your server’s max_execution_time variable. For more info on this error see this guide from WPBeginner. Logs performance and misc. The activity logs are stored in their own database table, {$wpdb->prefix}wpf_logging, so they generally shouldn’t have any performance affect on the rest of your site. In addition the table is limited to 10,000 entries, after which the oldest entries will be automatically begin to be dropped. You can flush the logs database at […]

Read More

Sending data to two different CRMs (Intercom Example)

[…] up the user based on their email address. If there were no errors, and a contact ID was found, then we update the user’s metadata for future usage. If no contact exists, return false. Sending new user registrations to Intercom, in addition to ActiveCampaign This next function shows how you can create new Intercom contacts at user registration, after they’ve been added to ActiveCampaign. function wpf_add_to_intercom( $user_id, $contact_id, $post_data ) { // Get the Intercom CRM object $intercom = wpf_connect_to_intercom(); // Check if there’s already a contact record in Intercom $contact_id = $intercom->get_contact_id( $post_data ); if( ! is_wp_error( $contact_id ) && $contact_id == false ) { // If there’s no existing contact, let’s create one // You have to manually specify Intercom internal fields here // since the WPF Settings >> Contact fields tab is configured for ActiveCampaign $contact_data = array( ’email’ => $post_data, ‘name’ => $post_data . ‘ ‘ . $post_data ); // “false” in the second parameter tells it not to use the field mapping set up in the WP Fusion settings $contact_id = $intercom->add_contact( $contact_data, false ); } // Save the contact ID for later reference update_user_meta( $user_id, ‘wpf_intercom_contact_id’, $contact_id ); // Now you can apply tags $intercom->apply_tags( array( ‘Tag One’, ‘Tag 2’ ), $contact_id ); } add_action( ‘wpf_user_created’, ‘wpf_add_to_intercom’, 10, 3 ); This function is hooked to the ‘wpf_user_created’ action, which is triggered whenever a user registers on your site and a new CRM contact has been created (in this case in ActiveCampaign). Here’s what we’re doing: First we get the Intercom CRM object, either by creating it and configuring the access token, or by retrieving the existing CRM object from the global if it already exists. Next, we use the wpf_get_intercom_contact_id() function (above) to see if we can get a contact ID for the new user. Even though they just registered on the site, they may already be in Intercom… so we check that to avoid creating duplicate contacts. If there was no error in looking up the contact ID, and a contact ID doesn’t exist, we proceed to create a new contact: Because WP Fusion is configured for ActiveCampaign, the settings under WP Fusion >> Contact Fields won’t be accurate here. In this case I’ve used Intercom’s internal ’email’ and ‘name’ fields to create the contact. But any contact data can be added in this way. See here for a list of the internal field names for an Intercom contact record. Finally, we utilize the Intercom CRM object to create the new contact, by calling $intercom->add_contact( $contact_data, false ); This will return the contact ID of the newly created Intercom contact. After the contact has been created, we save the contact ID to their user meta for future use. And now, with a contact ID available, you can apply any tags that you’d like to be added at registration. Applying tags in Intercom when they’re applied in ActiveCampaign This function follows a similar format as the previous one, but this time we’re using the ‘wpf_tags_applied’ hook, which is fired whenever a tag has been applied by WP Fusion. In this case, any tags that have been applied in ActiveCampaign will be applied simultaneously in Intercom. function wpf_apply_tags_in_intercom( $user_id, $tags ) { $intercom = wpf_connect_to_intercom(); $contact_id = wpf_get_intercom_contact_id( $user_id ); if( $contact_id !== false ) { $intercom->apply_tags( $tags, $contact_id ); } } add_action( ‘wpf_tags_applied’, ‘wpf_apply_tags_in_intercom’, 10, 2 ); Here’s what we’re doing: As before, we’re either creating or retrieving an existing CRM object […]

Read More

The WP Fusion CRM API

WP Fusion takes a completely original approach to connecting WordPress to our supported CRMs and marketing automation systems. There is no other plugin available that is as flexible or extensible. Normally, with a plugin like Gravity Forms (for example), you would download one of several available add-ons that connect Gravity Forms to your CRM of choice, like the ActiveCampaign add-on or AgileCRM add-on. These are created from scratch and use code unique to the API in question. Before WP Fusion, many sites would have to use several different plugins to get a basic level of integration with their CRM. An ActiveCampaign user might need ActiveCampaign add-on for Gravity Forms, ActiveWoo to send WooCommerce order data, and the official ActiveCampaign plugin to enable site tracking and embedding forms. This introduces a lot of unnecessary overlap, with the ActiveCampaign SDK being included multiple times, and redundant API calls being sent. How we solved that problem When designing WP Fusion, we realized that all of these CRM systems offer the same basic functionality: adding new contacts, updating existing contacts, applying and removing tags, and loading contact data from the CRM. So with that in mind, we created a wrapper class for each CRM, with a standardized set of functions to send and receive data from WordPress, then reformat it according to the rules of each API. Every one of our integrations has at least the following methods: connect() wp_fusion()->crm->connect( $auth = null, $test = false ); The connect() function is called by all the member functions in the class to initialize the connection to the CRM. It’s not necessary to use this in your code, but it can be used to validate an API key or OAuth token by setting $test to true. Parameters: $auth (string) (Optional) The API key or other authorization code required to connect. There may be more than one parameter depending on the CRM. If this is left blank, WP Fusion will use the authentication data you entered on the original setup page. $test (bool) (Optional) If set to true, WP Fusion will also verify the connection by attempting to make an API call. Return values: true (bool) If the connection was successful $error (WP_Error object) If the connection was unsuccessful sync_tags() wp_fusion()->crm->sync_tags(); Loads all available tags from the CRM and updates the available tags in the tag dropdowns for WP Fusion. Return values: $tags (array) An array of tags in the CRM $error (WP_Error object) If the API call failed sync_crm_fields() wp_fusion()->crm->sync_crm_fields(); Loads all available fields and custom fields from the CRM and updates the available fields in the dropdowns for WP Fusion. Return values: $crm_fields (array) An array of available fields in the CRM $error (WP_Error object) If the API call failed get_contact_id() wp_fusion()->crm->get_contact_id( $email_address ); Looks up a contact ID in the CRM by their email address. Parameters: $email_address (string) The email address to search for a contact by Return values: $contact_id (int) A contact ID for that email address false (bool) If no contact ID was found with that email address $error (WP_Error object) If the API call failed get_tags() wp_fusion()->crm->get_tags( $contact_id ); Loads a contact’s tags from the CRM. Parameters: $contact_id (int) The contact ID to load tags for Return values: $tags (array) An array of tag IDs for the contact (or an empty array if no tags were found) $error (WP_Error object) If the API call failed apply_tags() wp_fusion()->crm->apply_tags( $tags, $contact_id ); Applies one or more tags to a contact. Parameters: $tags (array) An array of tags to apply $contact_id (int) The contact ID to apply the tags to Return values: true (bool) The tags were successfully removed $error (WP_Error object) If the API call failed remove_tags() wp_fusion()->crm->remove_tags( $tags, $contact_id ); Removes one or more tags to a contact. Parameters: $tags (array) An array of tags to remove $contact_id (int) The contact ID to remove the tags from Return values: true (bool) The tags were successfully removed $error (WP_Error object) If the API call failed add_contact() wp_fusion()->crm->add_contact( $contact_data, $map_meta_fields = true ); Adds a new contact to the CRM. Parameters: $contact_data (array) An associative array containing the data for the new contact, with the WordPress field as the key and the data as the value, like array( ‘user_email’ => ’[email protected]’ ); $map_meta_fields (bool) If set to true, WP Fusion will convert the field keys from WordPress meta keys into the field names in the CRM. Set to false to bypass this conversion. Return values: $contact_id (int) The contact ID for the newly created contact $error (WP_Error object) If the API call failed or the data was rejected update_contact() wp_fusion()->crm->update_contact( $contact_id, $contact_data, $map_meta_fields = true ); Updates a contact in the CRM. Parameters: $contact_id (int) The contact ID to update $contact_data (array) An associative array containing the update data, in the same format as add_contact(); $map_meta_fields (bool) If set to true, WP Fusion will convert the field keys from WordPress meta keys into the field names in the CRM. Set to false to bypass this conversion. Return values: true (bool) The contact was successfully updated $error (WP_Error object) If the API call failed or the data was rejected load_contact() wp_fusion()->crm->load_contact( $contact_id ); Loads the contact record for a contact ID and returns an associative array of WordPress field / value pairs, based on the WP Fusion “Contact Field” settings. Parameters: $contact_id (int) The contact to load Return values: $user_meta (array) Array containing the contact data $error (WP_Error object) If the API call failed or the contact was not found load_contacts() wp_fusion()->crm->load_contacts( $tag_id ); Searches the CRM for any contacts with the specified tag and returns an array of contact IDs. Parameters: $tag (int or string) The tag to search by Return values: $contact_ids (array) Array of contact IDs […]

Read More

Is WP Fusion hard to use?

“Is WP Fusion hard to use?” That’s a question we get asked a lot. The answer is yes, and no. Where it’s easy When you first connect WP Fusion to your CRM, it will automatically configure itself based on the plugins you have installed on your site. New users who register or customers who […]

Read More

Infusionsoft / Keap Enhanced Ecommerce

[…] (or Keap) account for sales made in: WooCommerce Easy Digital Downloads Event Espresso GiveWP Gravity Forms LifterLMS MemberPress and Restrict Content Pro Getting Started After you install the Ecommerce Addon (or update to the latest version), WP Fusion will load a list of all configured products in your Infusionsoft account, and attempt to match […]

Read More

wpf_forms_post_submission

This action is run when WP Fusion has finished processing a form entry from one of our supported form plugins. It can be used to perform additional actions with the contact ID that was created in your CRM, for example triggering an event, or updating a note/opportunity. To use the code examples below, add them […]

Read More

Contributing integration modules

[…] code must be documented following the PHP documentation standards. For an example of a properly coded and documented integration module, see the integration bootstrap plugin,  or for a real- world example look at WP Fusion’s YITH WooCommerce Multi Vendor integration. Internationalisation: All strings should be translatable via gettext. The textdomain for WP Fusion is wp-fusion.

Read More

Working with Tags

[…] addition to Tags as a way of segmenting subscribers. In this case, lists are usually used like “mailing lists”— they are a way of sending your email newsletters to the correct audience. With lists, subscribers can manage their own memberships (unlike tags). For example a customer can unsubscribe from one list, but continue receiving […]

Read More

ActiveCampaign Enhanced Ecommerce

[…] Ecommerce Addon (available for Plus and Professional license holders) allows you to track customer purchases and lifetime revenue in ActiveCampaign for sales made in: WooCommerce Easy Digital Downloads Event Espresso GiveWP Gravity Forms LifterLMS MemberPress and Restrict Content Pro After installing the plugin, go to the WP Fusion settings page and click on the Enhanced Ecommerce tab to see the configurable options. Deep Data Note: Deep Data integration with ActiveCampaign requires a Plus level plan or higher. Warning: If you’re connecting WooCommerce to ActiveCampaign via WP Fusion’s Deep Data integration, make sure you’ve deactivated and disconnected ActiveCampaign’s native WooCommerce integration, as having two active connections will result in duplicate order data. WP Fusion includes support for ActiveCampaign’s Deep Data API. On the Enhanced Ecommerce tab in the WP Fusion settings, check the box next to Deep Data and save the settings to initialize the connection. In your ActiveCampaign account, navigate to the settings and click on the Integrations tab. You should see WP Fusion listed. Any sales made in any of the supported plugins will be added to the corresponding contact record using the new deep data display. ActiveCampaign will automatically track lifetime revenue, total orders, and total products purchased for the contact. Note: When WP Fusion is connected to ActiveCampaign via Deep Data, ActiveCampaign will apply a tag “WP Fusion-customer” to anyone who makes a purchase. This is an ActiveCampaign feature and can’t be turned off, though the tag can be removed using an automation. How it looks Deep Data from WooCommerce showing on the contact record in ActiveCampaign The order details are shown inside ActiveCampaign Deep Data order showing selected product attributes, with the Sync Attributes setting on. Refunds ActiveCampaign doesn’t have a specific order state for “refunded”. However, when Deep Data is enabled, if an order is refunded or cancelled in WooCommerce the order total in ActiveCampaign will be updated to $0.00 so that lifetime values are still calculated accurately. Coupons ActiveCampaign’s email editor has a coupon block that can be used to insert a WooCommerce coupon into an email campaign. At the moment the coupon block is not supported with WP Fusion. Since the coupon is not unique per contact (i.e. everyone who receives the campaign receives the same coupon), we’ve found it’s just as easy to create the coupon in WooCommerce and copy the code into the campaign email. However, if you would prefer to have access to the coupon block, you can disable the Enhanced Ecommerce addon for WP Fusion, and instead use ActiveCampaign’s WooCommerce plugin. Revenue Tracking Note: If you’re using our Deep Data integration with ActiveCampaign, revenue tracking is handled automatically by ActiveCampaign. You only need to set up revenue tracking if you’ve elected not to use the Deep Data API. To set up revenue tracking, first create a new contact custom field in ActiveCampaign. This field will be used to track the total amount spent by a customer in your store. If the field doesn’t appear in the Total Revenue Field dropdown, begin typing the name and click “Resynchronize” at the prompt to load the new custom field from ActiveCampaign. Whenever a customer checks out on your store, this field will be incremented with the total value of their purchase.   Deals Tracking For more advanced ecommerce automation, ActiveCampaign’s Deals system is one of the best systems available. Using the Enhanced Ecommerce Addon, WP Fusion can create deals in ActiveCampaign with the order value and other details, and associate those deals with the originating customer. Note: The Deal settings will be hidden if your ActiveCampaign account doesn’t support Deals, or if you haven’t created any Pipelines or Stages yet. If you’ve just created a new Pipeline, click Resynchronize on the Setup tab to reload the available Pipelines and Stages. The settings should now be visible. How to Enable Deals To enable deals tracking, first check the box next to Deals in the Ecommerce Tracking settings. Next select a pipeline and stage where new deals will be inserted (deals can later be moved using automations). If you’ve just created a pipeline or stage and it doesn’t appear in the list, go to the Setup tab and the Refresh Available Tags & Fields button to reset the list of available pipelines and stages. Once enabled, deals will be added to ActiveCampaign like in the screenshot below. Each deal will have a title indicating the plugin that created the deal and order number. The deal value will be set to the total value of the purchase, and the deal will be assigned to the contact record who made the order. A note will be attached to the deal containing the products purchased and a link to view the associated order in your WordPress admin. Using ActiveCampaign’s Automations you can then move deals between stages, create followup tasks, set deal statuses, and much more. Custom deal fields WP Fusion does not have the ability to directly map custom order fields with custom deal fields (for example options collected by WooCommerce Product Options). However, you can use an automation to copy the values from the contact record to custom deal fields. Since WP Fusion creates the contact at checkout before the deal, we will use Contact’s deal stage changes as the start trigger for the automation, to ensure the contact is fully saved. Next, set any entry criteria, for example you can limit the trigger to only a specific stage, or to only contact’s with a specific tag. Connect the trigger to an Update a custom deal field action. And in the settings, select your custom deal field, and choose Copy data from an existing Contact as the action. For the Value, select the custom field on the contact to copy the value from. You can add multiple fields by clicking the Add a field link. Finally, for Affects, select Triggered Deal, to ensure that only the deal that was just created is updated. In the example above, we have an automation that is triggered whenever a deal is created in the Order Placed deal stage, by contacts who have the tag Event Attendee. The action copies the value of Event Name from the contact to the Registered Event Name on the deal. This lets us see the name of the ticket the contact registered for (for example with The Events Calendar / Event Tickets). Video – Enhanced Ecommerce – ActiveCampaign Developers The Enhanced Ecommerce addon has three filters specific to ActiveCampaign, wpf_ecommerce_activecampaign_add_deal, wpf_ecommerce_activecampaign_add_deal_note and wpf_ecommerce_activecampaign_add_deep_data depending on whether you’re syncing Deals or Deep Data. Deal Filter For example to modify the deal title: function my_custom_deal_properties( $deal, $order_id ) { /* $deal is structured like (see https://developers.activecampaign.com/reference#create-a-deal-new) $deal = array( ‘title’ => ‘WooCommerce Order #XXX’, ‘value’ => 100, ‘currency’ => ‘usd’, ‘pipeline’ => ‘1’, ‘stage’ => ‘1’, ‘contactid’ => ‘123’, ‘owner’ => ‘1’, ); */ $deal = ‘My Order #’ . $order_id; // Change the title return $deal; } add_filter( ‘wpf_ecommerce_activecampaign_add_deal’, ‘my_custom_deal_properties’, 10, 2 ); Deal Note Filter For example to modify the note description: function my_custom_note( $note, $order_id ) { $note = ‘My custom note for order #’ . $order_id; return $note; } add_filter( ‘wpf_ecommerce_activecampaign_add_deal_note’, ‘my_custom_note’, 10, 2 ); Deep Data Filter For example to record the use of a WooCommerce coupon: function my_custom_deep_data_properties( $data, $order_id ) { /* $data is structured like below (for more info https://developers.activecampaign.com/reference#create-order) $data = array( ‘ecomOrder’ => array( ‘externalid’ => ‘123’, ‘source’ => ‘1’, ’email’ => ’[email protected]’, ‘orderNumber’ => ‘123’, ‘orderProducts’ => array( ‘externalid’ => ‘PROD12345’, ‘name’ => ‘Pogo Stick’, ‘price’ => 4900, ‘quantity’ => 1, ‘category’ => ‘Toys’, ‘sku’ => ‘POGO-12’, ‘description’ => ‘lorem ipsum…’, ‘imageUrl’ => ‘https://example.com/product.jpg’, ‘productUrl’ => ‘https://store.example.com/product12345’ ), ‘orderUrl’ => ‘https://store.example.com/wp-admin/edit.php?post_id=123’, ‘orderDate’ => ‘2016-09-13T17:41:39-04:00’, ‘totalPrice’ => 4900, ‘currency’ => ‘USD’, ‘connectionid’ => ‘1’, ‘customerid’ => ‘123’, ), ); */ $order = wc_get_order( $order_id ); $coupons = $order->get_coupon_codes(); // See if a coupon was used if ( ! empty( $coupons ) ) { // Add it to the deep data $data = array( array( ‘name’ => $coupons, ‘type’ => ‘order’, ‘discountAmount’ => $order->get_total_discount(), ), ); } return $data; } add_filter( ‘wpf_ecommerce_activecampaign_add_deep_data’, ‘my_custom_deep_data_properties’, 10, 2 ); ac-setup

Read More

Salesforce Enhanced Ecommerce

[…] data as Orders to your Salesforce account for sales made in: WooCommerce Easy Digital Downloads Event Espresso GiveWP Gravity Forms LifterLMS MemberPress and Restrict Content Pro Getting started Once you install the addon, the Enhanced Ecommerce tab will appear in the WP Fusion settings. To begin syncing orders with Salesforce, you must set an account ID for all orders. Once this is set, your new orders will begin syncing into Salesforce automatically. How it works When a customer checks out on your site, WP Fusion will create a new order in Salesforce with the order label, date, and total. The products purchased will be added to the order as items, including their individual prices and quantities. This order will be associated with the contact record who made the purchase. Associating products with Salesforce products When editing any product, download, plan, or membership level in any of the supported Enhanced Ecommerce plugins, you will see a dropdown where you can select an associated Salesforce product. If the product you’re looking for doesn’t appear, click the Refresh Available Tags and Fields button in the WP Fusion settings to update the list. If you don’t select a product, then at checkout WP Fusion will: Attempt to find a product in Salesforce by searching its name and SKU If no match is found, a new product will be created based on the product details in WordPress How it looks Orders appear in Salesforce with their details and order items. Order items are associated with the order and the corresponding pricebook entry. Known limitations Accounts Salesforce requires an Account for all new orders. At the moment, WP Fusion associates all orders with a single account ID (set in the WP Fusion settings). We are exploring options for automatically creating Accounts based on customer data, and this will be included in a future release. Custom fields The integration does not currently support updating custom fields on orders or products (though it is supported via filters, see below). We will make it a priority to find a solution for this in upcoming updates. Pricebooks At the moment WP Fusion just interfaces with the standard pricebook. We will look into adding support for multiple pricebooks in a future update. Modifying the API data WP Fusion supports using filters to modify the data sent to Salesforce with an ecommerce order. The order data can be modified using the wpf_ecommerce_salesforce_add_deal filter. In this example, we overwrite the order title to use a custom title, My custom order title, with the order number. function my_custom_deal_properties( $deal, $order_id ) { /* $deal is structured like: $deal = array( ‘0’ => array( ‘method’ => ‘POST’, ‘url’ => ‘/services/data/v57.0/sobjects/Order’, ‘referenceId’ => ‘orderRef’, ‘body’ => array(, ‘AccountId’ => ‘0013u00001AD9OzAAL’, ‘Name’ => ‘WooCommerce Order #1989’, ‘EffectiveDate’ => ‘2023-06-06’, ‘Status’ => ‘Draft’, ‘Pricebook2Id’ => ’01s6A000001rZ0EQAU’, ‘ShipToContactId’ => ‘0036A0000078r6QQAQ’, ‘BillToContactId’ => ‘0036A0000078r6QQAQ’, ‘CustomerAuthorizedById’ => ‘0036A0000078r6QQAQ’, ), ), ‘1’ => array( ‘method’ => ‘POST’, ‘url’ => ‘/services/data/v57.0/sobjects/OrderItem’, ‘referenceId’ => ‘orderItemRef0’, ‘body’ => array(, ‘OrderId’ => ‘@{orderRef.id}’, ‘PricebookEntryId’ => ’01u3u00000CGLymAAH’, ‘Quantity’ => ‘1’, ‘UnitPrice’ => ‘99.00′, ), ) ) ); */ $deal = ‘My custom order title #’ . $order_id; return $deal; } add_filter( ‘wpf_ecommerce_salesforce_add_deal’, ‘my_custom_deal_properties’, 10, 2 );

Read More