# Collection

A `Collection` widget allows you to integrate a collection into your product or website to deliver contextual education.

## **Creating a Widget**

To create a `Collection` type widget, click the `New` button in the top right corner and then click `Collection`. A side panel opens to create a new widget:

* Choose the render mode of your widget:
  * `Embed`: the widget is in embed format, you can integrate it anywhere on your site or application.
  * `Modal`: the widget appears in a window that will open when a button is clicked.
  * `Drawer`: the widget appears in a side panel that will open when a button is clicked.
* Give it a `title`. :bulb: This title will not be visible in the widget once integrated into your application.
* Select a collection using the search bar.
* Click `Create`: your widget is now ready to be integrated! :point\_right: [More information here.](/english/manage-spot/widget/implementation.md)

## **Editing a Widget**

You can edit a widget from two different places:

* From the widget list, by clicking the three small dots to the right of a widget card and then clicking `Edit`.
* From the widget Preview window, by clicking the `Edit` button.

### **General Tab**

From the `General` tab, you can modify:

* The **widget's render type**. Please note that changing the widget type means you will need to update the code.
* The widget **title**.
* The **selected collection**: to do so, simply click the `X` button in the top right corner of the selected collection and use the search bar to find the collection of your choice.

Once all your changes are made, click the `Save` button.

### **Statistics Tab**

From the `Statistics` tab, you can access your widget's usage data:&#x20;

* A first section called `Widget Data` gives you usage figures related to the widget as a whole:
  * `Views`: the number of times the widget has been viewed.
  * `Document clicks`: the number of times members have clicked on documents in the collection.
  * `Last updated`: the date of the last modification of the widget.
* The second section, `Document clicks`, details activity on the widget based on the collection's documents. For each document, you will see:
  * The number of clicks on that document.
  * A progress bar showing the number of clicks on the document relative to the total number of clicks on the widget.
* In the last section (`Collection Data`), you will find general data about the collection:
  * `Documents`: the number of documents in the collection.
  * `Last updated`: the date of the last document modification.

An `Open Collection` button allows you to access the collection in the Spot.

## **Widget Preview**

The widget preview depends on its render type:

* If it is an `Embed` or `Modal` type widget: clicking on a widget card opens a window. In this window, you can see a preview of how the widget will look in your application or website (in the case of an embed, grey areas represent your site's content).
* If it is a `Drawer` type widget: clicking on a widget card opens a side panel. You can see a preview of how the widget will look in your application or website.

At the bottom of the modal, there are several buttons:

* `Get the code`: gives you the choice between sending the widget code directly by email (with the `Send instructions` button) or retrieving and copying the widget code (with the `Copy code` button).
* `Edit`: allows you to open the editing side panel.

## **Widget Display**

On your site or application, many members will be able to access your widget. Don't worry, they will only see the collection if they have access to it.

To access a collection, the member must:

* Be logged in.
* Have access to the collection (either because the collection is public, or because it is private but the member has been invited to it).

{% hint style="success" %}
If a member views the widget collection and has access to it, the corresponding activity will be recorded and you will be able to find it on the `Dashboard` page in your Spot settings.
{% endhint %}

**To ensure the user sees the widget content while logged in, we recommend setting up SSO authentication in the widget integration space.**

{% content-ref url="/pages/yvDOKM9ZwM2EL2JVX7Oc" %}
[Single Sign-On](/english/manage-spot/sso.md)
{% endcontent-ref %}

{% hint style="info" %}
Once SSO is configured, it is possible to pass the JWT token authenticating the user directly in the widget script. More information here.
{% endhint %}

## **Deleting a Widget**

To delete a widget, you have 2 options:

* From the widget card, by clicking the three small dots on the right and then `Delete`.
* From the widget's editing side panel, by clicking the three small dots in the top right corner and then `Delete`.

Clicking either of these buttons opens a confirmation window.

{% hint style="danger" %}
Warning, all deletions are permanent!
{% endhint %}

{% hint style="info" %}
If you delete a widget in your Spot settings, it is advisable to also remove it from your application or site's code — don't worry if you forget, your members will simply see an empty space 😉
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.meltingspot.io/english/manage-spot/widget/collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
