Skip to content

Upgrading to v2

Introduction

Upgrading to v2 is an easy process and you'll keep your previous smartwall configuration.

Upgrade JavaScript integration

Find where you're adding the SmartWall SDK and change the version in the CDN link like in the next example.

<html>
    <head>
        ...
        <script src="https://sdk.smartwall.ai/?v=2"></script>
    </head>
    <body>
        ...
    </body>
</html>

Also, if you're adding the SDK's CSS manually remove it. The next line should be removed since it's no longer necessary in v2.

Remove:

<link href="https://sdk.smartwall.ai/?css&v=1" rel="stylesheet" type="text/css”>

Next, update the parameters passed to the SDK's constructor. There are parameters that are deprecated and new ones that are required.

Deprecated:

Remove them for v2

  • smartWallId - Becomes smartwallUid

  • articleId - Becomes articleUid

  • userId - Becomes userUid

  • protectAreaSelector - Becomes articleSelector. Now SmartWall in front-end mode, always protect the article locking it as soon as possible.

  • smartWallAreaSelector - The SmartWall will be placed at the bottom of the article. If you want to place it somewhere else read here.

  • selectorCSS - Becomes articleSelector.

  • initComplete - Becomes onReady.

  • articleUnlocked - Becomes onUnlock.

  • videoAreaSelector

  • onVideoHide

  • multiple

Required:

Add these for v2

  • smartwallUid - Previous smartWallId.

  • articleUid - Previous articleId.

  • articleSelector - Previous selectorCSS.

  • apiKey

To see an example of how the constructor should look like, you can go to v2 front-end integration.

Finally, if you're using SmartWallMetric object to send custom metrics to the SmartWall API, instead you should do it as described in here.