Magento 2

Get Started

Install Clerk on Magento 2 following these easy steps

Get Clerk up and running on your Magento 2 store in just a few steps. This guide walks you through connecting your store, installing the extension, and syncing your data.

Connecting your store #

The first step of installing Clerk is connecting your store with your Clerk account.

After following these simple steps you will be able to see your Demo Store, which gives you a personal overview of how Clerk will work on your webshop, before setting up the rest of the system.

Add store #

After logging in to my.clerk.io, the first thing you need to do is add your store:

Add new store form
  1. Write the Name and Domain of your webshop.

  2. Choose Magento 2 as the Platform and choose your Currency.

  3. Click Add Store.

Install extension #

You can install the extension using our Toolbox Script or via Composer.

composer require clerk/magento2
php bin/magento module:enable Clerk_Clerk
php bin/magento setup:upgrade
php bin/magento setup:di:compile

After installation, configure the extension:

  1. In your Magento backend, go to Stores > Configuration > Clerk > Settings.

  2. Select the correct Store View using the store selector in the upper left corner.

  3. Enter your Public Key and Private Key, then click Save Config.

Magento 2 Clerk settings

Keys location #

Your Public Key and Private Key are in my.clerk.io > Developers > API Keys.

Sync data #

  1. Go to my.clerk.io > Data > Configuration.

  2. Enter your webshop URL and any optional settings you need.

  3. If you plan to use Email & Audience, set Collect Emails to Yes in the Magento extension and Save.

  4. Select the language for your domain if applicable.

  5. Click Start Sync and wait for the sync to complete.

Your store is now connected to Clerk.

Full installation example #

In this video you can get a complete overview of what it takes to setup Clerk on a Magento 2 webshop.

Multiple storeviews #

The easiest way to implement Clerk in multiple Store Views in standard setups is by creating a separate Store for each domain in my.clerk.io.

This way, you can separate products, sales, currencies etc. to keep track of each Store View.

  1. Start by creating your main Store and follow the Setup Guide to connect your Store to Clerk and choose the Recommendations and/or Search Results that you want to display on your webshop.

  2. When you are done with the initial setup, go back to the start page of my.clerk.io (by clicking the Clerk logo in the upper left side corner of the side-menu) and then click "+ Add new store" the last option of the scroll down list (generally under you the existing store(s) and your company name):

Add new store dropdown
  1. On the Add New Store page, click Advanced to see all settings.
Advanced settings
  1. Fill in the details of your Storeview, and choose your main Store from the Copy Elements From Existing Store dropdown, then click Add Store. This will carry over the Elements and Designs from your main Store.
Copy content from existing store
  1. Now you can follow the Setup Guide again - by clicking on Getting Started, to Sync Data from this Storeview. As you have already installed the extension you can skip the first step and directly start configuring it and syncing data.

Note: If you are using Storeviews with hidden URL’s, like mywebshop.com?__store=b2b. Make sure to include the __store parameter in the Data Sync Store URL. Sometimes, these URLs can also contain 3 underscores like this: mywebshop.com?___store=b2b

Store URL with store parameter
  1. In the Magento 2 backend, on the Clerk Extension page, choose the Store View from the Store View dropdown:
Store view dropdown
  1. This will allow you to sync the Store View with your Store at my.clerk.io through the Setup Guide.

  2. When Data Sync has finished, your Store View is ready and using the same setup as your main Store.

Remember to translate Headlines, in Element-> Edit -> Select Design to the right language as well.

You can follow this process for all Store Views you want to use Clerk with.