# Drift

### Step 1: Configure Custom Attribute in Drift&#x20;

First, create a custom attribute in Drift with the name "Zipy Session Url". This attribute will be used to store and display the Zipy session URL in the Drift conversations. Follow the instructions provided by Drift's documentation on how to create custom attributes and make sure to enable the "Show in conversation" option for the "Zipy Session Url" attribute. Save the changes.

For more information on creating custom attributes in Drift, you can visit this link: [Link to Drift's Data Types documentation](https://devdocs.drift.com/docs/data-types-in-drift)

<figure><img src="/files/ur3KOa5e1G3YdUH2vzsp" alt=""><figcaption></figcaption></figure>

### Step 2: Add Code to Your Site&#x20;

Next, add the following code snippet to your website. This code listens for the "message:sent" event in Drift and retrieves the Zipy session URL using the `getCurrentSessionURL()` function provided by the Zipy library. After a slight delay (1.5 seconds), the code sets the user attribute "Zipy Session URL" with the retrieved URL using the Drift API.

```javascript
drift.on("message:sent", function(data) {
    const zipySessionUrl = window.zipy.getCurrentSessionURL();
    drift.api.setUserAttributes({
      "Zipy Session URL": zipySessionUrl
    });    
});
```

### Step 3: Verify Zipy Session URL in Drift Support Requests&#x20;

After completing the above steps, whenever a user sends a message to Drift support, the Zipy session URL will be displayed in the conversation. This allows support agents to easily access the Zipy session URL and provide more targeted assistance to users.

<figure><img src="/files/bc7rZ28wDDdZEtoePDUA" alt=""><figcaption></figcaption></figure>


---

# 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://docs.zipy.ai/integration/drift.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.
