Changelog

Changelog

1.7.0 - 7/2/2021

Moved cart storage out of transients and into a custom post type
Added support for auto-applied discounts with EDD when using cart recovery URLs
Improved - Abandoned cart tracking at checkout will also identify the visitor to site tracking scripts with supported CRMs
Improved - Cart recovery links with WooCommerce and EDD will identify the visitor to site tracking scripts with supported CRMs
Fixed Sendinblue contacts with + symbols in their email address not working with cart recovery URLs
Fixed errors recovering carts when both WooCommerce and Easy Digital Downloads are active at the same time

1.6.8 - 5/28/2021

Fixed cart recovery not working with WooCommerce 5.2.x
Fixed errors when WP Fusion wasn't connected to a CRM

1.6.7 - 3/10/2021

Added support for syncing cart discounts to ActiveCampaign (Deep Data) from Easy Digital Downloads and WooCommerce
Added Cart Discount Code and Cart Discount Amount fields for sync
Added wpf_abandoned_cart_apply_tags filter
Added wpf_abandoned_cart_data filter
Improved - Cart fields have been moved to the Contact Fields settings tab
EDD cart recovery will now restore cart discounts, fees, and the selected payment gateway
EDD cart recovery will now pre-fill customer information

1.6.6 - 2/22/2021

Improved - customer_id created by an ActiveCampaign cart will now be passed to the Enhanced Ecommerce addon at checkout
Fixed error adding products to cart with ActiveCampaign and Deep Data categories being generated from product attributes
Fixed Easy Digital Downloads cart tracking not working when only one payment gateway was active
Fixed fatal error activating the Abandoned Cart addon with WP Fusion Lite

1.6.5 - 1/8/2021

Added download image URL to cart data with Easy Digital Downloads
Added product description to cart data with Easy Digital Downloads and WooCommerce

1.6.4 - 9/28/2020

Improved pre-filling the checkout fields when using the recovery link
Fixed compatibility bug with WP Multilang
Fixed some bugs when syncing a cart during an active auto-login session
Updated for tags select compatibility with WP Fusion 3.35

1.6.3 - 8/11/2020

Fixed abandoned cart actions not running when EDD payment gateway was changed
Added .pot file

1.6.2 - 5/11/2020

Fixed fatal error with EDD getting cart recovery URL

1.6.1 - 4/28/2020

Fixed cart recovery URL not working with CRMs without cart support

1.6 - 4/22/2020

Added LifterLMS abandoned cart tracking
Added Sync Carts support for Easy Digital Downloads
ActiveCampaign integration will now update an existing cart if one exists instead of creating a new one
Fixed MemberPress trying to sync carts during WooCommerce checkout
Fixed MemberPress assigning an empty tag if no abandoned cart tag was specified

1.5.4 - 2/24/2020

Added support for currencies other than USD with ActiveCampaign Deep Data
Fixed cart recovery links not restoring variation IDs

1.5.3 - 2/17/2020

Added per-product abandoned cart tagging to MemberPress
Added option to sync selected product attributes to categories in Drip
WooCommerce integration will now inherit store settings regarding product prices being inclusive vs exclusive of tax
Fixed MemberPress abandoned cart tags not being applied to logged in users

1.5.2 - 1/23/2020

Added Deep Data / Shopper Activity support for MemberPress abandoned cart tracking
Fixed not detecting email field properly on some MemberPress checkouts

1.5.1 - 11/20/2019

Fixed time zone calculation in ActiveCampaign cart data

1.5 - 11/11/2019

Added MemberPress integration
Added support for WooCommerce product variations in cart data with Drip and ActiveCampaign
Added option to send prices tax-inclusive with WooCommerce
Fixed time zone calculation for occurred_at with Drip
Fixed tags not applying for guest checkouts with EDD

1.4.1 - 9/19/2019

Added option to select cart image size for Drip and ActiveCampaign
Added progressive updates for checkout form data

1.4 - 6/12/2019

Added Deep Data Abandoned Cart support for ActiveCampaign
Added support for auto-applied coupons during cart recovery
Recovered abandoned carts will now pre-fill the name and email address at checkout
Fixed Drip Shopper Activity cart recovery URL not syncing if URL was also being sent to a custom field

1.3.1 - 6/4/2019

Fixed product variations breaking Shopper Activity abandoned carts with Drip

1.3 - 4/22/2019

Added Shopper Activity API support for Drip
Added option to change the cart recovery URL destination

1.2 - 4/16/2019

Added option for syncing total cart value to a custom field

1.1 - 3/18/2019

Fixes for tags sometimes not applying when "On Add to Cart" setting was enabled
Abandoned cart async actions will only run once per checkout form

1.0 - 1/25/2019

Fallback for when product ID isn't present on variation cart items
Fix for sending cart recovery URL for logged in users

0.9 - 8/23/2018

Bugfixes

0.8 - 8/22/2018

Updated WooCommerce settings storage

0.7 - 8/16/2018

Added cart recovery URL for WooCommerce

0.6 - 12/22/2017

Added abandoned cart tags for Woo / EDD product variations

0.5

Fixed issues where sometimes duplicate contacts would be created

0.4

Compatibility updates for WPF v3.3
WooCommerce 3.0 fixes

0.3

Fixed checkout errors

0.2

Added support for per-product tagging
Added option to apply tags on Add To Cart for logged in users

0.1

Initial release

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

wpf_woocommerce_payment_complete

wpf_woocommerce_payment_complete

#Overview
This action is triggered whenever WP Fusion has completed processing a WooCommerce order
#Parameters

$order_id: (int) The order ID
$contact_id: (string) The contact ID that was created or updated at checkout

#Examples
#Send a custom field to your CRM
The example below will update a custom field in the CRM (with key order_total) with the order total after an order has been placed.
function my_woo_payment_complete( $order_id, $contact_id ) {

$order = wc_get_order( $order_id );

$update_data = array( 'order_total' => $order->get_total() );

wp_fusion()->crm->update_contact( $contact_id, $update_data, false );

}

add_action( 'wpf_woocommerce_payment_complete', 'my_woo_payment_complete', 10, 2 );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

wp_fusion_init

wp_fusion_init

#Overview
This action is triggered after WP Fusion has loaded (specifically on the init hook at priority 0).
It can be used to initialize any functionality that depends on WP Fusion.
Note: This action will not fire if WP Fusion is not connected to a CRM.
#Examples
#Register an additional order status for sync
This example registers a custom WooCommerce order status tbh-unpaid for sync with your CRM.
function wpf_add_custom_order_status() {

add_action( 'woocommerce_order_status_tbh-unpaid', array( wp_fusion()->integrations->woocommerce, 'process_order' ) );

}

add_action( 'wp_fusion_init', 'wpf_add_custom_order_status' );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

ConvertKit Abandoned Cart Tracking

ConvertKit Abandoned Cart Tracking

There are a lot of strategies for tracking and following up on abandoned carts. This guide will provide an overview of how to set up a basic abandoned cart tracking workflow for ConvertKit.
abandoned-cart-config
First, go to the Addons tab under the WP Fusion settings and select a tag to be used for abandoned cart tracking. You use an existing tag, or type a new one into the box. WP Fusion will automatically apply this tag to the user when checkout is begun, and the tag will be removed if checkout is completed successfully.
Next, log into your ConvertKit account and create a new Automation. The automation should be triggered when the 「Abandoned Cart」 tag is added. Add a timer (one hour is usually a good amount), and after the timer create a condition like in the picture below.

Anything under the 「Yes」 part of the condition will be run if the contact has begun checkout but hasn』t completed it within the specified time. From here you can add the contact to a list, send an email, and/or create an internal task for further followup. See the image below for an overview of the entire automation.

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

Additional Code Examples

Additional Code Examples

#Overview
We have a growing library of code examples for WP Fusion over at GitHub. Some examples:
#Access Control
#Add the current user』s tags as classes to the HTML body element:

#Delete a user in WordPress when a specific tag is applied:

#Bypass WP Fusion』s content restriction on RSS feed content:

#Unlock any locked content when visited from a Facebook link:

#Bypass WP Fusion』s content protection when someone accesses your site from a specific IP address:

#Syncing Data
#Sets users imported by webhook to have usernames generated from their first and last names, instead of email address:

#Extends the HTTP timeout to 60 seconds:

#Custom Objects
#Change CRM object type to Leads for Salesforce:

#Create / update a custom object in Zoho or Salesforce when a post is updated:

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

wpf_forms_post_submission

wpf_forms_post_submission

#Overview
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 to your active theme』s functions.php file.
#Parameters

$update_data (array): This is an array of data that was synced to the CRM
$user_id (int): The user who submitted the form, 0 if a guest
$contact_id (string): The ID of the contact record created / updated by the form submission
$form_id (int): The ID of the submitted form

#Examples
#Redirect an Elementor forms submission to an auto-login URL on another site
This example runs when an Elementor form is submitted and overrides the form』s redirect to https://siteb.com/?cid=Xwhere X is the ID of the contact record that was just created or updated by WP Fusion.
This redirect will then start an auto-login session for that contact on https://siteb.com
function wpf_custom_redirect( $update_data, $user_id, $contact_id, $form_id ) {

if ( wp_doing_ajax() ) {

$redirect_url = 'https://siteb.com';
$query_args = array( 'cid' => $contact_id );

wp_send_json_success( [
'message' => 'Success!',
'data' => array( 'redirect_url' => add_query_arg( $query_args, $redirect_url ) ),
] );
}

}

add_action( 'wpf_forms_post_submission', 'wpf_custom_redirect', 10, 4 );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

Drip Abandoned Cart Tracking

Drip Abandoned Cart Tracking

#Overview
Using WP Fusion you can track abandoned carts in WooCommerce and Easy Digital Downloads and follow up on them in Drip.
There are two ways to do this, either via Drip』s Shopper Activity API, or using the older tag-based method.
 
Shopper Activity API #New
The Shopper Activity API supports syncing the full cart contents to Drip when a customer updates their cart in WooCommerce.
To enable this feature check the box for Sync Carts from the Addons tab in the WP Fusion settings.

You can also specify the page the customer should be taken to when they click on the cart recovery link. The Current Page option can be used if you have multiple checkout pages (for example with CartFlows).

Note: With this method enabled it』s not necessary to use tags for tracking cart abandonment, and it』s not necessary to use a custom field for the recovery URL.

#Setup in Drip
When a customer begins checking out a new cart will be created in Drip, which will trigger the 「Created a cart」 action. When a customer adds something new to their cart it will trigger the 「Updated a cart」 action. You can use these actions as an entry point for your workflows.

Drip includes a pre-built workflow called 「Ecommerce Blueprint: Cart Activity Abandoned Cart」, which can be installed from here, and works with WP Fusion without any additional configuration.
Update: Drip』s 「Dynamic Content」 element for cart recovery does not work reliably with WP Fusion since it was built for Shopify. But the same effect can be achieved by adding some Liquid code to your cart recovery email.
The code is:
{% for item in event.items %}

{{ item.name }}

Price: ${{ item.price }}

Quantity: {{ item.quantity }}

View Product

{% endfor %}

To edit the Liquid code in your Drip emails, click on any text area and switch over into Source mode by clicking the  icon, then paste in the code above.

Your email should then look something like this:

See the Drip documentation for more info on the syntax for Liquid tags.
The cart recovery link can be added by creating a button with the URL {{ event.cart_url }}.

#How it looks
Your customer』s cart contents will be merged into the email, including product names, prices, and images.

#Video – Abandoned Cart Drip (Shopper Activity API)

#Troubleshooting
When a customer begins to check out you should see an entry appear (within a couple of minutes) on their activity stream in Drip with the cart contents.

If this entry doesn』t appear or you experience other unexpected behavior with abandoned cart tracking, please first turn on WP Fusion』s activity logs and begin a test checkout to trigger the abandoned cart actions.

The Abandoned Cart Addon will write detailed information to the logs, which you can include in your support ticket.
 
#Tag-based method
This method is available for people who don』t want to use the Shopper Activity API.
#Setup in WordPress
First, go to the Addons tab under the WP Fusion settings and select a tag to be used for abandoned cart tracking.

You use an existing tag, or type a new one into the box. WP Fusion will automatically apply this tag to the user when checkout is begun, and the tag will be removed if checkout is completed successfully.
#Setup in Drip
Next, log into your Drip account, select Workflows from the Automation dropdown, and create a new Workflow. The automation should be triggered when the 「Abandoned Cart」 tag is added. Add a timer (one hour is usually a good amount), and after the timer create a decision like in the picture below.

Anything under the 「Yes」 part of the decision will be run if the contact has begun checkout but hasn』t completed it within the specified time. From here you can add the contact to a list, send an email, and/or create an internal task for further followup. See the image below for an overview of the entire automation.

In this example we wait for one hour after the cart was abandoned, then send a one-off email to the customer to follow up.

#Recovery URLs
WP Fusion supports saving a customer』s abandoned cart in WooCommerce and syncing a recovery URL to Drip, which can be sent in an email. To set this up, enter a field to be used to store the cart recovery URL.

Then in your abandoned cart email (see above), insert a link, using the Liquid Tag for the recovery url.

When the customer clicks the link in the email, they』ll be taken to the WooCommerce checkout with their cart contents restored.
#Video – Abandoned Cart Drip (Tag-based)

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

Applying and Removing Tags with JavaScript

Applying and Removing Tags with JavaScript

#Overview
WP Fusion has a basic JavaScript API that lets you apply and remove tags from the current logged in user.
The AJAX methods are apply_tags and remove_tags, and they accept a comma-separated list of tags.
Note, to make use of the wpf_ajax.ajaxurl variable, Link Click Tracking should be turned on in the WP Fusion settings, on the Advanced tab. You can also use your own ajaxurl variable.
#Examples
#Apply tags with JavaScript
var data = {
'action' : 'apply_tags',
'tags' : 'Tag One, Tag Two'
};

$.post(wpf_ajax.ajaxurl, data);

#Remove tags with JavaScript
var data = {
'action' : 'remove_tags',
'tags' : 'Tag One, Tag Two'
};

$.post(wpf_ajax.ajaxurl, data);

#Additional examples
Also see this tutorial by WPAutomationLab on using WP Fusion』s JavaScript API with Google Tag Manager.

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

Automatic Discounts

Automatic Discounts

#Overview
WP Fusion』s WooCommerce integration has the ability to automatically apply a discount based on a contact』s tags in your CRM.
This can be used in conjunction with the Abandoned Cart addon to automatically give a discount to customers who abandon their carts.
#Setup
First create a coupon in WooCommerce. In this example we』ve created a coupon called Recovered Cart Discount with a 10% discount.

Then click on the WP Fusion tab, and select a tag that should trigger the discount.

In this example we』re using the Abandoned Cart tag. You can also make product specific coupons and use product specific tags to trigger them.
You can optionally override the discount label and discount message, or leave them at their defaults.
Then head over to Settings » WP Fusion » Addons and configure the same tag to be applied when a cart is abandoned.

#How it works
When a customer begins checkout a contact record will be created and the Abandoned Cart tag will be applied.
If you』re using Drip or ActiveCampaign the recovery URL will be sent along with the rest of the cart details, and can be merged into an email sent to the customer.
For other CRMs, the cart recovery URL will be synced to the custom field specified in the Recovery URL setting. This will look like https://mysite.com/cart/?wpfrc=xxxxxxxxx.
Heads up: If you are using a Recovery URL custom field in your CRM as the parameter for a button or link in an email, it』s recommended to turn off Google Analytics tracking on that link.
The reason is that the UTM parameters can get appended to the contact ID, which causes the cart recovery not to work.
When the customer follows this link they』ll be taken back to your site, their cart contents will be restored, and their information will be pre-filled on the checkout form.

WP Fusion will load the contact』s tags, and when it detects the Abandoned Cart tag it will automatically apply the associated discount.

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

wpf_pushed_user_meta

wpf_pushed_user_meta

#Overview
This action is triggered whenever WP Fusion has synced metadata to the CRM for a user.
#Parameters

$user_id: The user ID
$contact_id: The ID of the contact that was updated in the CRM
$user_meta: The metadata that was synced to the CRM

#Examples
#Generic example
function generic_function( $user_id, $contact_id, $user_meta ) {

if ( 'Active' == $user_meta['custom_field_key'] ) {
// Do something here.
}
}

add_action( 'wpf_pushed_user_meta', 'generic_function', 10, 3 );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No