Installing Plugin for WooCommerce Sites

The Yespo plugin allows you to manage your WooCommerce website’s marketing campaigns within one Customer Data Platform.

Plugin Features

The plugin allows you to:

  • Transfer contacts from your site to Yespo.
  • Synchronize order data (historical and new).
  • Transfer website events, such as user activity, visited pages, cart and order contents as the plugin installs the tracking script on your WooCommerce site.
  • Automatically register a domain, get and install the script and service worker, simplifying the entire Web Push configuration process.

After integration, you will be able to:

  • Organize automatic onboarding workflow for new contacts.
  • Enrich contact profiles with the data from your alternative platforms, such as mobile apps.
  • Send bulk omnichannel campaigns.
  • Set up transactional message chains.
  • Analyze campaigns’ performance in real-time.
  • Collect Web Push subscribers and message them in the corresponding channel.

When installed, the plugin allows sending the following events to Yespo as described in the table below.

Event

Description

PageView

This event is sent when a site visitor loads a particular website page. Default event, required for all other web tracking events to work.

ProductPage

The event is associated with actions on your product pages. It can be used for campaigns involving abandoned view, discount notifications for viewed items, or win-back campaigns.

CategoryPage

It is triggered when a visitor views a product category page. After receiving this event in Yespo, you can send emails with recommendations of the most popular products in the viewed category.

CustomerData

This event relates to the site visitor’s data received when they register, log in, or complete a purchase. The event links your website visitors to accounts in your system, enabling personalized campaigns.

StatusCart

The event helps to track the status of your customers’ shopping carts. It can be used for running ecommerce workflows, such as abandoned cart, discount notifications for products in the abandoned cart, and notifications for discounts on products similar to those in the cart.

PurchasedItems

It informs about the purchased items and can be used for compiling lists of popular products for recommendations, upselling, and cross-selling. For example, if a customer purchased a phone, you can send them a message with recommendations featuring a phone case or a charger.

MainPage

It is triggered when a visitor is currently on the main page. Necessary to display recommendations on the site.

NotFound

This event tracks 404 page. Necessary to display recommendations on the site.

ProductImpression

This event is used to show impressions for recommendation blocks in Reports.

In case of deactivation, the plugin ceases to perform its functions. 

Uninstalling the plugin removes all components configured during the setup of web tracking, including scripts and functions used for event tracking.

📘

Note

  • The plugin relies on data transfer via cron jobs. Ensure you have an active cron set up: either the default WordPress cron or a server-side cron on your hosting.
  • If you're using any caching plugins, make sure to install updates through the WordPress repository and clear your cache afterward to ensure all changes are properly applied.
  • Additionally, you can manually set up sending the AddToWishlist and SearchRequest events.

Installing Plugin

  1. Log into your WordPress account.
  2. Go to the Plugins section.
  3. Find Yespo in the search field and click Install now.

Or, 

  • Go to the WordPress plugins page. 
  • Find Yespo in the search field and click Download.
  • Upload plugin at the Plugins section of your WordPress account.
  1. Click Activate.
  2. Click the Settings button under the plugin on the Installed Plugins section or navigate to the separate Yespo page.
  3. Enter your full access API key from the Yespo account and click Synchronize to start data synchronization.
📘

Note

  • The access rights for the API key must be Full access to API. Read this article to learn about API keys in Yespo.
  • Yespo plugin supports multisite configurations for WooCommerce stores in WordPress. For correct data handling, each WooCommerce store must be connected to a separate Yespo account.

After clicking the Synchronize button, the new contacts’ and orders’ data that appear in WooCommerce will be automatically transferred to Yespo. The on-site event tracking configuration and Web Push script installation will also be completed. To ensure proper operation, make sure to add the product feed to Yespo.

📘

Note

  • You can always pause sending contact data to Yespo.
  • If the application has been deactivated and reactivated, contacts deleted during its inactivity will not be transferred to Yespo.

Please contact us if you have any questions or problems with integration.

Hooks, Tables, Functions and Other WordPress and WooCommerce Components

For the plugin to work correctly, it is necessary to have a number of standard WordPress and WooCommerce core elements in the system, as well as access to basic tables, functions, global variables and service directories.

Make sure of the following:

  • Standard WordPress system hooks have not been removed or deactivated in the theme or by other plugins. These hooks are active by default, so if they are missing, it may be due to remove_action or remove_filter being used intentionally.
  • Required WooCommerce hooks are present in the theme and functioning correctly. These hooks are essential for integrating with WooCommerce features and must be available in your setup.
  • WordPress tables are read-write. The plugin uses them to store settings, work with users, and orders.
  • Built-in WordPress functions are not overridden or blocked by third-party code. The plugin relies on them to handle requests, protect data, and communicate between the frontend and backend.
  • WordPress directories and service files are read-write. The plugin stores log files, Web Push files, and custom scripts in them.
  • WordPress and WooCommerce global variables are available. They are used to work with the database and orders.

If any of the listed components are missing, blocked, or modified, this may result in the plugin not working correctly or losing functionality completely.

Action WordPress Hooks

Name
Description

admin_notices

This hook displays messages in the admin notice area. It is part of the WordPress core and is not affected by front-end themes or their customizations. Used by WordPress itself and other plugins.

profile_update

Triggered when a user profile is created or updated. It belongs to the WordPress core and is independent of front-end themes or customizations. Used by both WordPress and third-party plugins.

delete_user

Triggered before a user is deleted. This core WordPress hook functions independently of theme customizations. Utilized by WordPress and external plugins.

wp_privacy_personal_data_erased

Triggered after a personal data erasure request is completed (GDPR). Part of WordPress core and not influenced by front-end theme customizations. Used within the WordPress core.

admin_enqueue_scripts

Used to enqueue JavaScript and CSS files that extend the admin panel's functionality. It is part of the core and not affected by front-end themes. Utilized by WordPress and plugins.

wp_footer

Adds custom code before the closing

</body>

tag. Part of the WordPress core, and not impacted by front-end themes. Used by both WordPress and plugins.

wp_login

Triggered after a successful user login. Core hook not affected by front-end customizations. Used by WordPress and other plugins.

wp_head

Adds scripts, styles, and meta tags for Web Push code to the site header.

WordPress Tables

Name
Description
wp_postsOne of the main database tables that stores all types of content for retrieving order data and further exporting to Yespo.
wp_usersStores data of all registered users for later export to Yespo.
wp_optionsStores global site settings, plugins, themes, cache, site URL, and other configuration values for storing API key, web tracking scripts, and Web Pushes.

Built-in WordPress Features

Name
Description
wp_remote_requestPerforming HTTP requests of any type (GET, POST, PUT, DELETE, etc.) to Yespo.
wp_localize_scriptPassing data (usually objects and strings) from PHP to JavaScript for use in a connected script.
esc_html_Translates a string and escapes it for safe output in HTML.
esc_jsEscapes text for safe use inside JavaScript code to prevent XSS attacks.
esc_urlCleans and escapes URLs before outputting them to HTML to prevent XSS attacks or malformed links.
esc_sqlEscapes strings inserted into SQL queries to prevent SQL injections.
wp_create_nonceCreates a one-time token (nonce) to protect against CSRF attacks when transmitting data via forms or AJAX requests.
wp_nonce_fieldDisplays a hidden field in the form with a nonce (one-time token) to protect against CSRF attacks.
wp_enqueue_scriptAdds JS files to the site to connect plugin scripts.
wp_send_jsonSends a JSON response and terminates the script.
wp_kses_postCleans up HTML, leaving allowed tags.
wp_send_json_successSends a JSON response about a successful operation.
wp_send_json_errorSends a JSON error response.
get_optionGets the values of options from the database (API key, web tracking scripts, and Web Pushes).
update_optionCreates or updates an option in the database (saving API key and scripts.)
sanitize_text_fieldCleans text from unwanted characters for storage in the database or options.
update_user_metaAdding a label that the contact was sent to Yespo.
get_user_bySearch for a user by ID.
wp_upload_dirReturns data about the download directory for web tracking and Web Push log files.
wp_parse_urlA wrapper around the PHP function parse_url(), which is more error-resistant and always returns an array for web tracking and Web Push logs.
wp_json_encodeEncodes a PHP array or object into a JSON string before sending the data to Yespo.

WordPress Directories and Files

Name
Description
/wp-content/pluginsDirectory for storing plugin files.
/wp-content/uploadsDirectory for storing Web Push files and web tracking logs.
admin-ajax.phpA file for processing AJAX requests to exchange data between the frontend and backend.

Filter WordPress Hooks

Name
Description
cron_schedulesUsed to add custom interval cron tasks. Utilized by both WordPress and third-party plugins.

Action WooCommerce Hooks

Name
Description

woocommerce_add_to_cart

Triggered when a product is added to the cart. Part of the WooCommerce core, initialized in

CartController.php

in

src/StoreApi/Utilities

.

woocommerce_after_cart_item_quantity_update

Triggered when the quantity of items in the cart is changed. Core WooCommerce hook, initialized in

class-wc-cart.php

in the includes directory, but not actively used by the plugin itself. Since

includes

files are rarely modified, the risk of this hook being broken is low.

woocommerce_cart_item_removed

Triggered when an item is removed from the cart. A core WooCommerce hook, initialized in

class-wc-cart.php

under

includes

. Actively used by WooCommerce. Since

includes

files are rarely modified, there’s minimal risk of this hook being affected.

woocommerce_thankyou

Triggered after an order is placed. Part of WooCommerce core, used in templates to show final order details. Initialized in

thankyou.php

under

templates/checkout

Since template files are often customized, there's a higher risk of hook initialization being overwritten.

Global Data

Name
Description
$wpdbA global object for working with MySQL.
WCA global object that provides access to WooCommerce orders and methods.
WC_OrderClass for working with orders.