# Wix

{% hint style="warning" %}
This courtesy guide is **no longer actively tested** by Openli, although it might still work.

Our cookie-consent widget intentionally uses a highly-compatible, highly-generic approach to integration. In most cases, it will be possible for your developers to adapt this guide's steps to any changes that might have been made to the target platform, in combination with their own general documentation. **Our** [**consent-state events**](https://docs.openli.com/docs/documentation/legaljs-widget/collecting-cookie-consent/consent-state-api#listening-for-consent-change-events) **might be useful for this.**
{% endhint %}

## How to add cookie consent on Wix.com?

{% hint style="danger" %}
In order to add Openli (or any other custom code) to wix.com you must have Premium membership on wix.com
{% endhint %}

## Before you start:

Before following these steps, please be sure that you have:

* [ ] Added your website's URL (*either during the signup process or in the settings page*)
* [ ] [Created cookie providers and categorised all cookies](https://docs.openli.com/docs/cookie-consent-management/get-started-with-legal-monster#step-2-create-your-cookie-providers)
* [ ] [Created a cookie policy](https://docs.openli.com/docs/cookie-consent-management/cookie-widget/how-to-create-a-cookie-policy)
* [ ] [Created a cookie widget](https://docs.openli.com/docs/cookie-consent-management/cookie-widget/how-to-create-a-cookie-widget)

Check step 1 - 4 in the [Get started with Openli ](https://docs.openli.com/docs/cookie-consent-management/get-started-with-legal-monster)guide to create all of the above.&#x20;

## Step 1: Code snippet

To install your cookie widget on Wix, you'll need your cookie widget code snippet.

![](https://1919043541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRMQvUsiQMLNstTU-cS%2Fuploads%2F55AmjjmZrEmL6ycwo3O8%2FScreenshot%202021-11-22%20at%2011.16.24.png?alt=media\&token=2342414e-8981-4bd3-bc4e-1dc041bafa92)

To find your code snippet, go to the Openli dashboard and select "**Widgets**" in the side menu. Click on the cookie widget you previously created and copy the code.&#x20;

It will look like this:

```javascript
<script>
    !function(){var i,e,t,s=window.legal=window.legal||[];if(s.SNIPPET_VERSION="3.0.0",i="https://widgets.legalmonster.com/v1/legal.js",!s.__VERSION__)if(s.invoked)window.console&&console.info&&console.info("legal.js: The initialisation snippet is included more than once on this page, and does not need to be.");else{for(s.invoked=!0,s.methods=["cookieConsent","document","ensureConsent","handleWidget","signup","user"],s.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(t),s.push(e),s}},e=0;e<s.methods.length;e++)t=s.methods[e],s[t]=s.factory(t);s.load=function(e,t){var n,o=document.createElement("script");o.setAttribute("data-legalmonster","sven"),o.type="text/javascript",o.async=!0,o.src=i,(n=document.getElementsByTagName("script")[0]).parentNode.insertBefore(o,n),s.__project=e,s.__loadOptions=t||{}},s.widget=function(e){s.__project||s.load(e.widgetPublicKey),s.handleWidget(e)}}}();

    legal.widget({
        type: "cookie",
        widgetPublicKey: "xxxxxxxxxxxxxxxxx",
    });
</script>

```

{% hint style="info" %}
Notice that the value for `widgetPublicKey` will be different in your code snippet
{% endhint %}

## Step 2: Add custom code&#x20;

To insert the code snippet on your page, go to "**Settings**" in your Wix website editor. In the dropdown menu select "Tracking & Analytics".&#x20;

![](https://1919043541-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRMQvUsiQMLNstTU-cS%2F-MG8Wj1_xZT9NFNEwLli%2F-MG8Zrp-JwvmAeN23p9o%2FScreenshot%202020-09-01%20at%2014.09.28.png?alt=media\&token=4d939f3a-637a-4e41-a7bc-f2ca9063ce38)

To add custom code press the "+ New Tool" button and select "Custom" from the dropdown.

![](https://1919043541-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRMQvUsiQMLNstTU-cS%2F-MG8Wj1_xZT9NFNEwLli%2F-MG8b4OuwvBDWDs92gr8%2FWixInstall.png?alt=media\&token=9772265d-2c76-4b19-b019-4ddc647cdae4)

Add the Openli cookie widget code snippet in the text area at the top and fill out the remaining fields. Please make sure that "Load code once" is selected under Add code to pages and that the "Body - start" option is selected under Place Code in.&#x20;

![](https://1919043541-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LRMQvUsiQMLNstTU-cS%2F-MG8Wj1_xZT9NFNEwLli%2F-MG8coF8a_V6Bs_CeKLt%2F2._wix_img.jpg?alt=media\&token=16ac633d-4d99-4400-a828-616ffc272fdb)

Once this is done, simply click "Apply" to save your changes.&#x20;

## Step 3: Blocking cookies

The final step you need to take to make sure your cookies are compliant is to block the scripts that set them on your website, so the widget can enable them only when a visitor gives consent.&#x20;

This step is a bit more technical, however, this guide shows you [how to categorise the scripts that set cookies on your website](https://docs.openli.com/docs/documentation/legaljs-widget/collecting-cookie-consent#categorisation-of-scripts-that-set-cookies-on-your-website) to enable blocking. You might need a developer to help you.&#x20;

## Done!

Congratulations on completing your first step towards collecting compliant cookie consent on Wix.com. Pad your self on the back and know that our mascot Li is proud of you.&#x20;

![](https://1919043541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LRMQvUsiQMLNstTU-cS%2Fuploads%2FP5L9Hk7egE96nLzqpVuv%2Fcookie-openli.png?alt=media\&token=cc21774f-ca82-4bf0-9308-2a0b2cf7f9d1)
