My Cart 0

User Manual - Customer Segmentation

Magento 2 Customer Segmentation is a tool for segmenting customers according to their sales history, buying behavior, and other personal details. 

 

 

Installing Customer Segmentation for Magento 2

Command Line Installation

  1. Backup your web directory and store database
  2. Download the Customer Segmentation installation package
  3. Upload the contents of the Customer Segmentation installation package to your store root directory
  4. In the SSH console of your server, navigate to your store root folder:
cd path_to_the_store_root_folder

run the following command:

php bin/magento module:enable Aheadworks_CustomerSegmentation

then:

php bin/magento setup:upgrade

after:

php bin/magento setup:static-content:deploy -f

     5. Flush the store cache; log out from the backend and log in again

Make sure the installation is done from the FTP administrator account. Otherwise, set 775 permissions to the store root directory after the extension has been deployed.

Composer Installation

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

     1. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

Run the following command:

composer config repositories.aheadworks composer https://dist.aheadworks.com/

On successful execution of the command you will be able to use the composer to install the extensions.

To install the extension:

     2. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

    3. Run the following command to install the latest version of the extension:

composer require aheadworks/module-customer-segmentation

if you need to install a specific version, run this command:

composer require aheadworks/module-customer-segmentation:<version>

 

Specify the version of the extension in <version>

When prompted, enter Public Key (Username) and Private Key (Password):

Public Key (Username) and Private Key (Password) | Customer Segmentation for Magento 2

Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

     4. Enable the extension:

php -f bin/magento module:enable <Module_Name>

 

Add the product name in <Module_Name>

Next, register the extension:

bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

bin/magento module:status

Clean store cache, by running the following command:

bin/magento cache:clean

Log out and Log in the backend again.

     5. Updating Customer Segmentation for Magento 2

Download the updated extension file from Marketplace or another extension developer. Take note of the module-name and version.

Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.

Update per module name:

composer update Aheadworks/<Module_Name>

Updater per version:

composer update Aheadworks/<Module_Name>:<Module_Version>

Run the following commands to upgrade, deploy, and clean the cache.

php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy
php bin/magento cache:clean

 

 

Uninstalling Customer Segmentation

Since Magento introduced declarative Database you need to be very carefull when uninstalling or disabling the module.

NOTE: Please be very careful when uninstalling/disabling this module. This module uses a declarative DB scheme. Once the module is uninstalled the DB tables will be lost.

Manual Removal

1. Disable the module by executing the following commands:

php bin/magento module:disable Aheadworks_CustomerSegmentation
php bin/magento setup:upgrade

2. Remove the extension files from the following folder:

app/code/Aheadworks/CustomerSegmentation

Automatic Removal (via Composer)

1. Disable the module by executing the following commands:

php bin/magento module:uninstall <Module_Name>

 

 

 

Compatibility

Module Version 

Magento Version 

PHP

1.2.4  and earlier versions

2.3.Х - 2.3.6

2.4.0 - 2.4.3

7.4 and earlier versions

As of version 1.2.6

2.4.0 - 2.4.4

7.4, 8.1

As of version 1.2.7

2.4.4 - 2.4.6

8.1

 

 

 

Introducing Customer Segmentation for Magento 2

Introduction

The Customer Segmentation extension for Magento 2 presents a tool to draw various segments of customers according to a number of customized rules and conditions. With the extension you are able to: 

  • Segment both registered and guest customers;
  • Customize rules and conditions for segmentation against a variety of parameters;
  • Use customers purchase track record, personal details and other information as parametres for segmentation;
  • Integrate the extension with the native Magento Newsletter and Cart Price Rules;
  • Move segments to groups;
  • Export segmented data to CSV or XML.

 

Customizing segments

To start work with the Magento 2 Customer Segmentation go to Customers → Customer Segmentation by Aheadworks → Customer Segments. 

Customer Segments Page

This is where you may view, edit the segments as well as add new ones. The segments are allocated into a table with four columns: Rule ID, Segment, Website, Status and Newsletter Subscription Status, which represent some most important details of segments settings. The table is easily customizable and searchable with the 'Columns', 'Default View' and 'Filters' active elements on the top right of the page.

Should you require further support beyond the present manual click 'Customer Segments' folding list and opt for Get Support.  

You may enable, disable or delete available segments individually or in bulk. Tick the boxes next to the chosen segments on the left of the table, click the 'Actions' folding list and opt for an operation.

To edit a segment click the active link of the segment name, to add a new segment click the 'Add New Segment' button on the top right of the page. These operations will take you to the Edit/New Segment page. 

Customer Segments Page | Customer Segmentation for Magento 2

New Segment and Edit Segment Pages

The New Segment and Edit Segment pages look identical, the name suggests the operation you are to do with the segment. This is where you may alter or add all the details of the segment, define rules for segmentation, and lookup for matched customers.

The image below reflects some basic details you are suggested to provide for each segment. They are as follows:

  • Status - enable or disable the segment here;
  • Segment Name -  provide a name for the segment;
  • Description - give details on the segment;
  • Assign to Website/Store view - the extension will index the data from the selected websites and store views only;
  • Newsletter Subscription Status - opt for a subscription status of customers who fall under the segment. 

New Segment and Edit Segment Pages | Customer Segmentation for Magento 2

The extension will reindex all enabled segments daily, so it is recommended to disable the unused ones to save time on reindexing.

Prior settings of the segment sorted, you may now proceed to the Conditions block of the segment.

Conditioning the segments

The Conditions block of the Edit/New Segment page allows:

  • Validating Customer Emails - enter the emails of the customers you think fall under segmentation for quick and fast check thereof
  • Customizing rules for segmentation -  condition the rules for segmentation

Unlike building a whole segment, the Validating Customer Emails option doesn't require reindexing, so it is a good option to verify whether the rule you have created is correct.

To add conditions for segmentation click on the Add button and choose an attribute for conditioning. For further configuration proceed to the 'ALL', 'TRUE', 'IS', '...' and other clickable parameters to alter them in accordance with your rule.

Pay attention to the limitations of Bundle Product type: the extension doesn't look for the attribute values in children products of a bundle, so if you need to find customers who purchased a bundle product, it is recommended to create conditions "SKU is/is not/contains/doesn't contain". 

From a performance perspective, it is recommended to put date conditions on a level as high as possible

When the rule is set, proceed to one of the following:

  • New segment - click the 'Save' button and reindex the rule.
  • Edit segment - click the 'Save' button, reindex the rule and refresh the page.

Run the following commands for reindexing:

 1. In the SSH console of your server, navigate to your store root folder:

cd path_to_the_store_root_folder

run the following command:

php -f bin/magento index:reindex aw_customer_segmentation

 

Please check more information in the Segmentation Use Cases to familiarise yourself with some examples of most demanded rules for segmentation.

To delete a condition click on the Delete (red cross) button.

Conditioning the segments | Customer Segmentation for Magento 2

Once the rule is set, saved and reindexed, you will be able to check the customers who match the segmentation, move them to groups or export to CSV. 

Checking segmented customers

After reindexing is done, scroll down the Edit/New Segment page to the 'Matched Customers' block to check the customers who match the segmentation. The list comes as a table with the following columns, the names of which speak for their content: Name, Email, Group, Country, Phone, Zip, State, City and Address. You may customize the view of the table the 'Columns', 'Default View' and 'Filters' active elements on the top right of the page.

To export the segment click 'Export' and choose the format of the file: CSV or XML.

To move the segment to a group select the customer entries, click 'Actions' and then 'Move to customer group'. A list of groups available will pop-up, where you will be able to finilize the operation.

Checking segmented customers | Customer Segmentation for Magento 2

Integrating Customer Segmentation

Logic of disabled segments

Intergration with Customer Segmentation presumes that the cooperating module will either receive a list of segments or feature the segment criteria and segments in rule conditioning. All segments, enabled and disabled, will be shown in the list/rule. The disabled segments will have a corresponding indication of thereof. 

If a disabled segment is selected in a rule, the rule will not trigger. If several segments are selected and some of them are enabled, the rule will be validated only against the enabled segments.  

Example:

A vendor creates a generic offer for customers representing a few segments. When one of the segments is disabled, no customer from this segment will receive the offer. Customers from other enabled segments, on the contrary, will keep on receiving the offer.

Logic of multiple websites

Magento 2 allows setting up multiple websites. The Multiple Website feature means that you can run more than one website from a similar Magento installation. You manage multiple websites from a single domain dashboard. 

If a customer scope is Global, the extension always checks the quantity of all orders, disregarding what website is set in the rule.

If a segment is selected from Website2, for a rule from Website1, that rule will not be applied. Make sure the segments come from the same website as the rules.  

Be careful removing the websites (stores, store views). When a website is removed, the link between the segment and the site is removed too. Consequently, the segment can be assigned to none of the available websites. Manual segment updating by a store admin may then be required.

More on Magento 2 Multiple Websites.

Integration with native Magento 2 modules

Customer Segmentation for Magento 2 allows for a few useful integrations, which help your promotional campaigns be more targeted and therefore effective. Once installed the module will integrate itself into the Cart Price Rules and Native Magento Newsletter.

Cart Price Rules Integration

To fine-tune the coupons as well as some other discounts which are to be applied at check-out or in cart with regard to a particular customer segment go to Marketing → Cart Price Rules. Pick up a rule from the list or start a new one. Complete the essentials and move down to the Customer Segments. Here you will find a list of segments available for selection.

Once you make up your choice and finalize the settings, the discount or coupon will be available only to registered customers in the chosen segment.

Cart Price Rules Integration | Customer Segmentation for Magento 2

More on native Magento cart price rules.

Native Magento Newsletter Integration

To personalize you email newsletters you may resort to a Customer Segments block too. This time you will have to proceed to Marketing → Newsletter Queue. Click a queue for editing and scroll the list of settings down to the Customer Segments block.  Finalize the queue, save the newsletter, and it will only be delivered to those registered customers who fall into the chosen segment.

Native Magento Newsletter Integration | Customer Segmentation for Magento 2

More on native Magento newsletters.

Integration with Aheadworks modules

Content Management modules

Customer Segmentation for Magento 2 can noticeably enhance the functionality of a few Aheadworks modules, basically meant to display all sorts of content, namely:

Customer Segmentation for Magento 2 allows specifying the display of content to customer segments. 

For the present extension to integrate well with Rich Banner Slider and Automatic Related Products please enable the "Compatibility with frontend extensions" option in Stores → Configuration → Aheadworks → Customer Segmentation.

It is not essential to have the option enabled for other extensions from the list above since they do not display  cachable content, based on customer segments. Having it otherwise will not affect the operation of the modules, though will increase the number of cached files and subsequently (though not necessarily to a radical extend) slow down the store.

 

It’s highly recommended to keep Customer Segmentation index updated. Refresh Full Page Cache after any modifications to the segments to eliminate incorrect content on the frontend.

Company Accounts

Integration with Company Accounts for Magento 2 allows Customer Segmentation for Magento 2 to specify companies into segments, which can then be used to fine-tune various marketing campaigns.

When the Company Accounts for Magento 2 module is enabled on the store, the Create/Edit Segment page has the following updates:

  • The Apply To configuration option is added to the Conditions tab. This is where you can specify if the segment is to include customers or companies. Thereby the two alternatives of the drop-down: Customer (by default) / Company. When Company is selected, the rule configuration block exchanges customer attributes to the company ones.

Company Accounts integration | Customer Segmentation for Magento 2

  • The Company column is added to the Matched Customers grid. The column can be filtered, sorted and hidden.

Matched Customers grid | Customer Segmentation for Magento 2

If a Company matches the rule, all members of the Company get into the given segment.

A note to developer

To get the array of segment ids assigned to a customer, a developer is to use an instance of the class:

Magento\Framework\App\Http\Context, method getValue(), parameter $name = 'aw_cs_customer_segment_ids'

see the following constant for reference

 Aheadworks\CustomerSegmentation\Model\Customer\Context::CONTEXT_AW_CS_SEGMENT_IDS

Integration with Advanced Reports

From the Customer Segmentation module version 1.2.3 or new, when Advanced Reports for Magento 2 is installed on the store, it becomes possible to specify segments, which can then be used as a filter for Advanced Reports. The filter by Customer Segments will work in both modules.

The logic is the following:

  • the sales data in the report are being related to a Customer segment list. When the user chooses the customer segment according to this the data in the report's grid are filtered.

When Filter by AW Customer Segments is enabled on the store, the drop-down with the created customer segments appears; if the filter is disabled the drop-down is hidden.

 

Integration with Add Free Product to Cart

Customer Segmentation (starting from version 1.2.7) is integrated with Add Free Product to Cart (starting from version 1.11.0). This integration enables you to target specific customer segments for promotional campaigns. You can choose which segments will be included or excluded from receiving free gifts, ensuring that customers don't receive the same promotional gift twice within a certain period based on their purchase history and previous free product acquisitions.

 

Integration with Order Success Page

Customer Segmentation (starting from version 1.3.0) is integrated with Order Success Page (starting from version 1.1.0). enabling the selection of specific customer segments for each rule. This integration allows you to create distinct promotional offers tailored to different customer segments directly on the order success page. 

To activate this integration, navigate to Configurations > Aheadworks Extensions > Customer Segmentation and set "Yes" in the "Enable compatibility with frontend extensions" field. 

Enable compatibility with frontend extensions | Magento 2 Customer Segmentation

When creating a rule for the order success page, a new field titled "Customer Segment" will appear, allowing you to specify the target customer segment for the offer.

 

Customer Segmentation Use Cases

Below you may find some sample rules for segmentation of customers alonside the explanations for the use cases.

1. List of clients who ordered a specific product at least 2 times

Use Cases | Customer Segmentation for Magento 2

“Number of Orders equals or greater than 2” filters out the customers who have only 1 order which contains 2 items of the same SKU. If this is not essential, you can set that value to 1.

2. List of clients who made a purchase at least 3 times since 11/01/2017

Use Cases | Customer Segmentation for Magento 2

3. List of clients who made a purchase at least two times during the past year for a global amount equals or greater than 200€

Use Cases | Customer Segmentation for Magento 2

4. List of clients who ordered products of a specific brand in May 2019

Use Cases | Customer Segmentation for Magento 2

5. List of clients who ordered products of a specific brand in the last 3 months

Use Cases | Customer Segmentation for Magento 2

Same idea as in the previous example with the only difference: Date From/To is replaced with the Date Period.

From a performance perspective, it is recommended to put the date conditions on a level as high as possible. For example, same result can be obtained should you do otherwise, however, such configuration will require an additional subrequest. While this will not be noticeable in smaller stores, it can save some time on reindexing in the stores with 100k+ orders.

6. List of clients who ordered a product from the specific categories

Use Cases | Customer Segmentation for Magento 2

7. List of clients who has the order(s) with a total of 100€ or more

Use Cases | Customer Segmentation for Magento 2

8. List of clients whose billing address is not in USA

Use Cases | Customer Segmentation for Magento 2

9. List of clients who have an account but did not order

Use Cases | Customer Segmentation for Magento 2

In this example, all customer groups were selected.

10. List of female clients older than 50 years old

Use Cases | Customer Segmentation for Magento 2

11. List of clients who used a promotion code at least once

Use Cases | Customer Segmentation for Magento 2

 

12. List of clients who bought a printer more than a year ago, but didn’t order ink or toner for the last year

Use Cases | Customer Segmentation for Magento 2

 

Customer Segmentation | Customer Segmentation for Magento 2

Product Page

Write Your Own Review

Already used our product?

We would appreciate your feedback. Please, leave a review.

Only registered users can write reviews. Please Sign in or create an account
Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us