Get Started

Smartweb: Get Started

Connecting your Store #

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

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

1. Add Store #

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

  1. Write the Name and Domain of your webshop

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

  3. Click Add Store.

2. Configure the Smartweb Feed #

From the main menu of the Setup Guide, click Install Extension:

The next page shows what you need to do, to configure the SmartWeb feed .

Follow the steps to enable visitor- and sales-tracking, and access to the SmartWeb feed:

3. Sync your store #

After allowing access, you simply need to synchronise your store.

Go back to the Setup Guide and click Sync Your Data:

Write in your stores details and click Start Sync:

Clerk.io will now import your products, categories and sales.

When its done, your store is connected. Good job!

Adding Clerk.js #

  1. Click the Settings icon in the side menu of your store and then on Tracking Code.

2. Copy the Tracking Script

3. Insert this code in the file that generates all pages.

       This is normally Kontrolpanel->Design Manager-> Rediger filer->index.tpl

4. Click Gem in the top of the page to save your changes.

Tracking orders #

  1. In the Smartweb Admin go to Modules → Checkout → checkout-approved.tpl

  2. Insert the following Sales-Tracking code in the bottom of the file, just before the closing

 tag.

{% raw %}{if !empty($page.orderId)}
    {entity controller=order assign=order id=$page.orderId userId=false statusId=false}

    {* Order Customer entity *}
    {entity controller=orderCustomer assign=orderCustomer orderId=$page.orderId}

    {* Order Lines collection *}
    {collection controller=orderLine assign=orderLines orderId=$page.orderId repay=false}

    {* Group order collection by class *}
    {$orderList = $orderLines->groupByClass()}

    {assign var=products value=''}

    {if $orderLines->getActualSize() gt 0}
        {if isset($orderList['CollectionOrderLine'])}
            {foreach $orderList.CollectionOrderLine as $orderLine}
                {$products = $products|cat:{ldelim}|cat:' "id": '|cat:$orderLine->ProductId|cat:', "quantity": '|cat:$orderLine->Amount|cat:', "price": '|cat:$orderLine->Price|cat:{rdelim}}

                {if !$orderLine@last}
                    {$products = $products|cat:', '}
                {/if}
            {/foreach}
        {/if}
    {/if}

    <span
        class="clerk"
        data-api="log/sale"
        data-sale="{$page.orderId}"
        data-email="{$orderCustomer->Email}"
        data-customer="{$user->Id}"
        data-products='[{$products}]'>
    </span>
{/if}{% endraw %}

4. Click Gem to save your changes.

Multiple Sites #

Clerk.io can easily be integrated in several Sites that share the same Smartweb / Hostedshop backend.

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

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

  1. Start by creating your main Store and follow the Setup Guide to connect your Store to Clerk.io 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.io 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):

     3. On the Add New Store page, click Advanced to see all settings.

4. Fill in the details of your webshop, and choose your main Store from the Copy Content From Existing Store dropdown, then click Add Store.

This will carry over the Content and Designs from your main Store.

5. Now you can follow the Setup Guide again, to activate Clerk.io by clicking on Getting Started, to Sync Data for the new site.

6. In your Smartweb backend, switch to the Site you want to setup.

7. This will allow you to activate Clerk.io on the Site through the Setup Guide at

my.clerk.io

8. When Data Sync has finished, your Site is ready and using the same

         setup as your main Store.

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

You can follow this process for all sites you want to use Clerk.io with.