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

# Wordpress

# WordPress Integration Guide

WordPress form plugins (WPForms, Gravity Forms, Contact Form 7) can POST directly to Trackly's webhook — no Zapier needed.

## Method 1: WPForms Webhook (Recommended)

### Step 1: Install WPForms + Webhooks Addon

1. Install **WPForms** (Lite or Pro)
2. Install the **WPForms Webhooks** addon (requires Pro plan), or use the free **WPForms Zapier** addon with a direct webhook URL

### Step 2: Create your form

1. Go to **WPForms → Add New**
2. Add fields:
   * **Phone** (type: Phone, name: `phone_number`, required)
   * **Consent Checkbox** (required) with label: "I agree to receive SMS marketing messages. Msg & data rates may apply. Reply STOP to unsubscribe."
3. Optionally add: First Name, Last Name, Email

### Step 3: Configure the webhook

1. Go to **Settings → Webhooks** in your form editor
2. Click **Add New Webhook**
3. Set the **Request URL** to:
   ```
   https://api.tracklysms.com/api/v2/optins/webhook
   ```
4. Set **Request Method** to `POST`
5. Set **Request Format** to `JSON`
6. Add **Request Headers**:
   * `X-Api-Key`: `trk_your_api_key_here`
   * `Content-Type`: `application/json`
7. Map your form fields:
   * Phone → `phone_number`
   * First Name → `first_name`
   * Last Name → `last_name`
8. Add **Additional Body** fields:
   * `list_id`: your Trackly sending list ID (integer)
   * `consent_text`: your TCPA consent language

### Step 4: Test

Submit the form and verify the contact appears in your Trackly sending list.

## Method 2: Gravity Forms Webhook

1. Install **Gravity Forms** + **Gravity Forms Webhooks** addon
2. Go to **Forms → Settings → Webhooks**
3. Add a webhook with URL: `https://api.tracklysms.com/api/v2/optins/webhook`
4. Set method to `POST`, format to `JSON`
5. Add header: `X-Api-Key: trk_your_api_key_here`
6. Map fields the same way as WPForms above

## Method 3: Iframe Embed

1. Add a **Custom HTML** block to any page or post
2. Paste:
   ```html theme={null}
   <iframe src="https://api.tracklysms.com/optin/page/YOUR_PUBLIC_TOKEN" width="100%" height="520" frameborder="0" style="border:none;max-width:480px;margin:0 auto;display:block;"></iframe>
   ```
3. Replace `YOUR_PUBLIC_TOKEN` with your opt-in configuration's public token

## Method 4: Script Tag

1. Install a plugin that allows custom code (e.g., **Insert Headers and Footers**, **WPCode**)
2. Add your script tag to the footer:
   ```html theme={null}
   <script src="https://api.tracklysms.com/optin/script.js?token=YOUR_PUBLIC_TOKEN" async></script>
   ```
