> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.writesonic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrating with Drupal

> This guide walks you through the process of implementing AI Bot Analytics on your Drupal website using the Writesonic AI Analytics module.

## Prerequisites

* An Active Writesonic account
* Admin access to your Drupal website
* Drupal 8.x or higher
* Composer CLI to download the module
* Drush CLI to install/uninstall the module (Optional)

## Phase 1: Start in Writesonic

1. Head over to the **AI Bot Analytics** page on Writesonic and choose ‘**Drupal**’ as provider.
2. Click ‘**Continue’** to initialize your integration

<img src="https://mintcdn.com/writesonic/dn64fE971vqZNBuD/images/docs/67293312715dcee290777cc4348502d50fb6f954cb8216d03dbd7476f594f355-image.png?fit=max&auto=format&n=dn64fE971vqZNBuD&q=85&s=17d523a6e9bd22568a57ff5a6dce1928" alt="" width="1838" height="1044" data-path="images/docs/67293312715dcee290777cc4348502d50fb6f954cb8216d03dbd7476f594f355-image.png" />

3. Writesonic will generate a unique API key for your website. Keep this page open as you'll need this API key during the module installation.

## Phase 2: Download the Drupal Module via Composer CLI

1. Open your terminal and navigate to your Drupal project root directory
2. Add this snippet to the root level composer.json, if it does not have already:

<CodeGroup>
  ```bash bash theme={"system"}

  "repositories": [
          {
              "type": "composer",
              "url": "https://packages.drupal.org/8"
          }
   ]
  ```
</CodeGroup>

3. Run the following composer command:

<CodeGroup>
  ```bash bash theme={"system"}
  composer require 'drupal/writesonic_ai_analytics:^1.0'
  ```
</CodeGroup>

4. Wait for the composer installation to complete
5. `writesonic_ai_analytics` module files must have been added to `*/modules/contrib` directory.

## Phase 3: Enable the Module

1. Log in to your Drupal admin dashboard
2. Navigate to **Extend** in the admin panel
3. Search for **'Writesonic AI Analytics'** in the dropdown list
4. Check the box next to the module and click **"Install"**

<img src="https://mintcdn.com/writesonic/d8tibQs3wr_nKdrf/images/docs/880d1cc57a4e7523129203f384498c54a1b65572d20b4d18640f97d4cf455378-image.png?fit=max&auto=format&n=d8tibQs3wr_nKdrf&q=85&s=bcc60c2867ece14d12012fb0c5a532ba" alt="" width="2848" height="1238" data-path="images/docs/880d1cc57a4e7523129203f384498c54a1b65572d20b4d18640f97d4cf455378-image.png" />

Alternatively, you can install it via Drush CLI:

<CodeGroup>
  ```bash bash theme={"system"}
  drush en writesonic_ai_analytics
  ```
</CodeGroup>

## Phase 4: Configure the Module

1. Navigate to **Configuration** > **System** > **Writesonic AI Analytics Settings** in your Drupal admin panel
2. Copy the API key provided by writesonic and paste it on the configuration page of your Drupal Website.

<img src="https://mintcdn.com/writesonic/nTROtF1WuUqhx9V0/images/docs/3cbd9f9da7e3476041e81d22fe270df40cffc2719a56d532668fde4d9841ecfd-image.png?fit=max&auto=format&n=nTROtF1WuUqhx9V0&q=85&s=18dad9ddd59fd9b0ecdef5a9c2530fc3" alt="" width="1830" height="1132" data-path="images/docs/3cbd9f9da7e3476041e81d22fe270df40cffc2719a56d532668fde4d9841ecfd-image.png" />

3. Click **"Save Configuration"** to finalize the setup

<img src="https://mintcdn.com/writesonic/c7y82ZhEtYaeYDpv/images/docs/2183aeda603d1c08b655bc90f1239db9770ec5abd4f732a5abe572be66e263d0-image.png?fit=max&auto=format&n=c7y82ZhEtYaeYDpv&q=85&s=6ca8c024fff1c673e503cf71e6276eef" alt="" width="2302" height="968" data-path="images/docs/2183aeda603d1c08b655bc90f1239db9770ec5abd4f732a5abe572be66e263d0-image.png" />

> Do not disable the Analytics Tracking unless you want to actually pause analytics data collection

## Phase 5: Verify Installation in Writesonic

1. Return to Writesonic AI Bot Analytics page.
2. Click on **"Verify Integration"** to confirm that your Drupal site is properly connected
3. Once verified, you'll be redirected to your analytics dashboard. The process typically finishes in 1–2 minutes but may take up to 5 minutes.

## Troubleshooting

If you encounter any issues during setup:

* Ensure your API key is entered correctly
* Verify that your Drupal site is publicly accessible
* Check that the module is downloaded and is present in the `*/modules/contrib` directory.
* Make sure that Analytics data collection is not disabled in the **Configuration > System > Writesonic AI Analytics Settings** page

For assistance, contact [\[email protected\]](/cdn-cgi/l/email-protection#67141217170815132710150e13021408090e044904080a)

## Managing the integration

### Disabling Analytics Data Collection and Ingestion

1. If you want to disable the analytics data collection, navigate to the **System > Configuration > Writesonic AI Analytics Settings**
2. Disable the Analytics Tracking
3. Click on ‘**Save configuration**’ to save your changes

<img src="https://mintcdn.com/writesonic/iNIgGEoh_nUcRO7A/images/docs/b6cdff5a76b5f6464c65ba459a64453702f0c567e3225fef72fe666b81bf6d9a-image.png?fit=max&auto=format&n=iNIgGEoh_nUcRO7A&q=85&s=4df11f61bbd5fce0eff60f223ac1aaab" alt="" width="2302" height="1090" data-path="images/docs/b6cdff5a76b5f6464c65ba459a64453702f0c567e3225fef72fe666b81bf6d9a-image.png" />

> This will pause the analytics data collection and ingestion from your drupal website to writesonic.

### Deleting/Uninstalling the Module

1. If you want to completely uninstall the module, you can navigate to **Extend** in your Drupal admin panel
2. Select the ‘Uninstall’ tab, and type ‘Writesonic AI Analytics’ in the search filter

<img src="https://mintcdn.com/writesonic/nTROtF1WuUqhx9V0/images/docs/473969f0914cda271f930581152bdb86fbc493a05aabd693b7183a500190364d-image.png?fit=max&auto=format&n=nTROtF1WuUqhx9V0&q=85&s=bf8b0985dc7cd96bc03f74562963448a" alt="" width="2330" height="986" data-path="images/docs/473969f0914cda271f930581152bdb86fbc493a05aabd693b7183a500190364d-image.png" />

3. Click on ‘Uninstall’ and confirm the uninstallation

<img src="https://mintcdn.com/writesonic/X3wiRgE7vzfy9Z8A/images/docs/1557e1bfc3e8a94ac96291ea8bbadfadaffa5e5b5a270a93ca5826d75fc0d9e2-image.png?fit=max&auto=format&n=X3wiRgE7vzfy9Z8A&q=85&s=9022c7f6046fed4a259c8ad56d671fd8" alt="" width="2210" height="736" data-path="images/docs/1557e1bfc3e8a94ac96291ea8bbadfadaffa5e5b5a270a93ca5826d75fc0d9e2-image.png" />

Alternatively, you can also uninstall the module via Drush CLI:

<CodeGroup>
  ```bash bash theme={"system"}
  drush pmu writesonic_ai_analytics
  ```
</CodeGroup>

4. To completely remove the writesonic\_ai\_analytics module and it’s files from your drupal project, you can run `composer remove writesonic_ai_analytics`

***

[Integrating with Vercel Log Drains](/docs/integrating-with-vercel-log-drains)

[Integrating With Fastly Log Streaming](/docs/integrating-with-fastly-log-streaming)
