=== GTMFunnels ===
Contributors: gtmfunnels
Tags: chatbot, chat widget, funnel, ai, agents
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Integrate GTM funnels AI agents with Wordpress. Display GTMFunnels AI chatbots on any WordPress page via shortcode or global floating button.

== Description ==

GTMFunnels integrates AI-powered agents and chat widgets from the GTMFunnels platform into your WordPress site. Connect your GTMFunnels account with an API key and embed AI enabled chat funnels anywhere on your site.

**Features:**

* Connect via API key — no copy-pasting embed code manually.
* Global floating chatbot — enable a sitewide chat widget from the Settings page.
* Shortcode support — embed a specific funnel on any page or post with `[gtmfunnels_chat funnel_code="YOUR_FUNNEL_CODE"]`.
* My Funnels page — browse all your funnels and copy shortcodes in one click.
* Transient caching — API responses are cached for 5 minutes to keep your site fast.

== Installation ==

1. Upload the `wp-gtmfunnels` folder to the `/wp-content/plugins/` directory, or install via the WordPress plugin installer.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **GTMFunnels → Settings** and enter your API key (generate one in GTMFunnels under My Account → API Keys).
4. Optionally enable the global floating chatbot and select a funnel.
5. Use the `[gtmfunnels_chat funnel_code="YOUR_FUNNEL_CODE"]` shortcode on any page to embed a specific funnel.

== Frequently Asked Questions ==

= Where do I get an API key? =

Log in to your GTMFunnels account, go to **My Account → API Keys**, and create a key with `funnels:read`, `chat:read`, and `chat:write` scopes.

= Can I embed a different chatbot on each page? =

Yes. Use the shortcode `[gtmfunnels_chat funnel_code="YOUR_FUNNEL_CODE"]` on individual pages or posts. When a shortcode is present, the global floating widget is suppressed for that page.

= Does the plugin cache API responses? =

Yes. Funnel lists and embed codes are cached as WordPress transients for 5 minutes. The cache is flushed automatically when you save new settings or click the Refresh button on the My Funnels page.

== Screenshots ==

1. The GTMFunnels chat assistant shown as a floating widget on a live WordPress page.
2. My Funnels admin page — browse your funnels and copy the shortcode or funnel code in one click.
3. Settings page — enter your API key, test the connection, and enable the global floating chatbot.
4. Your GTMFunnels account — the list of chat funnels available to embed.
5. GTMFunnels dashboard — funnel views and conversion analytics.
6. Front-end chat widget collecting a visitor's email to start the conversation.
7. Agents & Blueprints — the AI agent that powers your chat funnel.
8. Chat funnel settings — assign an AI agent to a funnel.
9. Chat widget settings — customize colors, title, and lead-generation options.

== External Services ==

This plugin connects to the GTMFunnels API to fetch your chat funnels and embed codes. Your API key is transmitted with each request. No data is stored by the plugin beyond WordPress transient cache (5-minute TTL).

* API endpoint (production): https://api.gtmfunnels.ai/api/v1/
* Privacy Policy: https://www.gtmfunnels.ai/privacypolicy
* Terms of Service: https://www.gtmfunnels.ai/termsofuse

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
