The Cordial extension for Magento Version 2 provides a turnkey solution to connect your Cordial account with your existing Magento V2 storefront for syncing customer behaviors (browse, purchase, etc.), profile data, order data and transactional data in real time.
In addition to data synchronization, the extension enables you to route all Magento promotional, triggered and transactional messages to messages within Cordial.
Cordial Extension for Magento Video
The following video will give you an overview of installing and setting up the Cordial extension for Magento:
Install the Cordial Extension
Download the Magento extension file that matches your Magento version and install using the Magento Extension Manager or command line: Magento2-2.3.4-p12.zip extension (updated 06.09.2022)
- Learn More about installing using the Magento Extension Manager
- Learn More about installing using the command line
- To install the Magento extension via Composer, the module name is
cordial/magento2-sync-module
- To install the Magento extension via Composer, the module name is
Configure the Cordial Extension
To get started with the Cordial extension you will need to enable the extension, provide your Cordial API and Account keys, map customer attributes and synchronize any existing Magento data.
Enable the Cordial Extension
- In your Magento account, navigate to the Configuration page of the Cordial extension: Cordial > Configuration.
- This will take you to the General Settings page. Make sure that your store view is set to Default Config and enable the Cordial extension using the Cordial Integration dropdown.
The JavaScript Listener script editor allows you to modify script parameters depending on your store configuration. For example, if you are using a vanity domain, add it as the data-cordial-url
and t.src
value to replace the default track.cordial.io entries. This will ensure that all relevant events are being tracked including order revenue attribution.
When using the JavaScript Listener, the following events are passed to Cordial.
- category view
- product view
- CMS page view
- products search
- cart page view
- checkout success page
- customer logout
- customer login
JS v1
requirejs([], function() {
var t = document.createElement("script");
t.setAttribute("data-cordial-track-key", "$accountkey");
t.setAttribute("data-cordial-url", "track.cordial.io");
t.setAttribute("data-auto-track", false);
t.src = '//track.cordial.io/track.js';
t.async = true;
t.onload = cordialMagento;
document.body.appendChild(t);
});
JS v2
(function(C,O,R,D,I,A,L){
C.CordialObject=I,C[I]=C[I]||function(){(C[I].q=C[I].q||[]).push(arguments)};
C[I].l=1*new Date,C[I].q=[],A=O.createElement(R);
L=O.getElementsByTagName(R)[0],A.async=1,A.src=D,L.parentNode.insertBefore(A,L);
})(window, document, 'script', '//track.cordial.io/track.v2.debug.js', 'crdl');
crdl('connect', '$accountkey', {
trackUrl: "//track-ehs-svc.cordial.com" ,
connectUrl: "//track.cordial.io" ,
cookieDomain: "cordial.io",
cookieLife: 365
});
Add your Cordial API Key
- In your Cordial account, on the API Keys page, create an API key by whitelisting the catch-all IP address: 0.0.0.0/0. Learn how to generate an API key
- In your Magento account, navigate to the Configuration page of the Cordial extension: Cordial > Configuration.
- Choose the Default Store View from the Store View dropdown menu.
- Paste the API Key into the Cordial API Key field and click Save Config.
api.usw2.cordial.io
Add your Cordial Account Key
- In your Cordial account, copy the account key on the Account Settings page under Account Info.
- In your Magento account, on the Cordial Configuration page (set to Default Store View), paste the account key in the Cordial Account Key field and click Save Config.
Your Cordial account should now be connected to the Magento extension and ready to map customer attributes and synchronize data.
Note that when the configuration is saved, the following changes will occur in your Cordial account:
- A list called Promotional will be added to your account. Contacts will automatically be added to this list if they subscribe on your Magento store.
- The following contact attributes will be added:
- lastPurchase
- m_wishlist
- magentoAlerts
- magentoDeleted
Map Customer Attributes
Before synchronizing Magento customers with your Cordial account, you will need to map all desired attributes.
You have the option to map attributes that already exist in your Cordial account, or create new attributes from within Magento and send to Cordial.
Map existing Cordial attribute keys
- Navigate to the Cordial Configuration page in your Magento account.
- Add the desired Cordial contact attributes keys and the corresponding Magento customer attribute codes in the customer attributes mapping table. Be sure that the Magento attribute codes match the codes in your store. You can view all your existing customer attributes by navigating to Store > Attributes > Customer (available in Enterprise edition only - see table below for a list of standard customer attributes).
- You can add more attributes by clicking the Add button. Once all attributes are added, click the Save Config button. Cordial attribute keys that already exist in your account will be mapped.
Below is a list of standard Magento customer attributes codes.
Magento Customer Attribute Code | Description |
---|---|
prefix | Name Prefix |
firstname | First Name |
middlename | Middle Name/Initial |
lastname | Last Name |
suffix | Name Suffix |
group_id | Group |
dob | Date of Birth |
default_billing | Default Billing Address |
default_shipping | Default Shipping Address |
taxvat | Tax/VAT Number |
confirmation | Is Confirmed |
created_at | Created At |
gender | Gender |
updated_at | Updated At |
Create and map new Cordial attribute keys
- Add the desired Cordial attribute keys to the customer attributes mapping table and click Save Config.
- Click the Send New Attributes to Cordial button to create and map the new attribute keys.
Synchronize existing Data and Templates
Once your Magento and Cordial accounts are connected, any future data will be automatically synchronized (unless individually disabled). If you have existing data in your Magento account at the time of connection, you can use the Post Data to Cordial option to post all existing data to your Cordial account. You are also able to post all existing Magento templates into your Cordial account using this method.
Note: you are able to disable syncing of individual products or customers by turning off Cordial Sync on each product or customer edit page.

To post Magento data to Cordial:
- Navigate to the Cordial Configuration page in your Magento account and locate the Post Data to Cordial section.
- Choose which data collections to post and click the Post Data to Cordial button.
Note: Posting order data to Cordial will not result in creation of duplicate order records. The post will first check for existing order data, which is updated if found, otherwise new order data is added.Note: When syncing templates, all template code including necessary external variables (extVars) will be saved into Cordial. You can also map Magento templates to existing templates in Cordial on the Template Mapping page.
- You can check the status of the sync by navigating to the Cordial Sync page.
- Locate the desired Sync job and check the Todo column. If the Todo column contains the value "nothing", then the sync performed without errors.
If the Todo column contains the value "Sync", then there was a problem with the job.
- You can view the status of any job by navigating to the Log page.
- Here you can view info on all API calls made to Cordial.
- To view specific info on the API call and response, click the Select dropdown and choose View.
Map Transactional Templates
You are able to map Magento templates to automation templates created in Cordial.
- Navigate to the Cordial Template Map page in your Magento account.
- Click the Map New Template button.
- Choose the desired Magento template and Cordial templates to map from the drop down menus.
- Click the Save Template button.
You can also edit existing template mapping.
- Click on the desired template to edit in the template list.
- Select new templates from the dropdown menus and click save.
Transactional Templates Supported
- Change Email
- Change Email and Password
- Contact Form
- Credit Memo Update
- Credit Memo Update for Guest
- Cron Error Warning
- Currency Update Warnings
- dotdigital System Alert
- Footer
- Forgot Admin Password
- Forgot Password
- Hard-declined Authorization
- Header
- Invoice Update
- Invoice Update for Guest
- New Account
- New Account Confirmation Key
- New Account Confirmed
- New Account Without Password
- New Credit Memo
- New Credit Memo for Guest
- New Invoice
- New Invoice for Guest
- New Order
- New Order for Guest
- New Shipment
- New Shipment for Guest
- New User NotificationOrder Update
- Order Update for Guest
- Order is Ready for Pickup
- Order is Ready for Pickup For Guest
- Payment Failed
- Price Alert
- Remind Password
- Reset Password
- Send Product Link to Friend
- Shipment Update
- Shipment Update for Guest
- Sitemap Generation Warnings
- Soft-declined Authorization
- Stock Alert
- Subscription Confirmation
- Subscription Success
- Unsubscription Success
- User Notification
- Wish List Sharing
Congratulations, your Magento account is now configured and connected to your Cordial account!
Comments
0 comments
Please sign in to leave a comment.