=== OXVO Connect ===
Contributors: oxvo
Tags: ai assistant, analytics, live chat, chat, customer support
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add OXVO AI Guide, OXVO Insights website analytics and OXVO Messenger live chat to your site with one site key.

== Description ==

OXVO Connect adds three services from [OXVO](https://oxvo.com) to your WordPress site:

* **OXVO AI Guide** is an AI assistant on your site. It answers visitor questions with the assistant you choose for it in OXVO, and helps visitors find their way around your site. With a visitor's permission, it can also act on the page, for example scroll, click or fill in a field. Session recording is optional and off by default. You can offer it in OXVO, and each visitor chooses whether to turn it on.
* **OXVO Insights** is website analytics. It shows how visitors find and use your site.
* **OXVO Messenger** is live chat. Visitors start a conversation on your site, and your team replies from OXVO.

You need an OXVO account. Copy the install code from OXVO Console, paste it into the plugin settings, and save. The plugin converts the install code into a site key that turns on AI Guide, Insights, Messenger, or any mix of them. You do not need to edit your theme.

What the plugin does:

* Uses one site key for AI Guide, Insights and Messenger. You can paste the AI Guide install code, the Insights installation code, the Messenger script, or several of them together.
* Lets you turn AI Guide, Insights or Messenger off at any time. A feature that is off is removed from your pages.
* Shows one chat at a time. While AI Guide is on, Messenger does not load. Turn off AI Guide to show Messenger instead.
* Can identify logged-in users in Messenger with their name, email address and user ID. The user ID is signed with your identity validation secret key on your server.
* Works with consent plugins that support the WP Consent API. Insights and AI Guide session recording follow the visitor's choice for statistics, as the WP Consent API reports it. AI Guide without session recording and Messenger do not depend on consent.
* Loads its script asynchronously, so it does not block your pages.
* Adds nothing to your site until you save a site key.

== Installation ==

1. In your WordPress admin, go to Plugins, Add New Plugin, and search for "OXVO Connect". Install and activate it.
2. Sign in to OXVO Console at [app.oxvo.com](https://app.oxvo.com).
3. For AI Guide, open your AI Guide, select the Installation tab and copy the install code. In the Security section of the same tab, add your site's address to Allowed websites.
4. For analytics, open Website installation in Insights and copy the installation code. For live chat, open your Messenger settings and copy the Messenger script.
5. In WordPress, go to Settings, OXVO Connect. Paste the code into "Site key or install code" and select "Save Changes".
6. Check the status panel. It shows what your site key turns on, and it warns you when the website address for Insights does not match your site.

== Frequently Asked Questions ==

= Do I need an OXVO account? =

Yes. AI Guide, Insights and Messenger are services from OXVO, and the install code comes from your OXVO account. Sign in at [app.oxvo.com](https://app.oxvo.com).

= Where do I find the install code? =

In OXVO Console. The AI Guide install code is on the Installation tab of your AI Guide. The Insights installation code is in Website installation. The Messenger script is in your Messenger settings. You can paste one of them, or several together.

= How do I add AI Guide? =

In OXVO Console, open your AI Guide, select the Installation tab and copy the install code. Paste it in Settings, OXVO Connect, and save.

AI Guide only appears on the websites in its Allowed websites list. Add your site's address to that list in the Security section of the same Installation tab, save it, and verify it.

When Record visitor sessions is on for your AI Guide, the site key includes session recording, and visitors can choose to turn it on in AI Guide. If you change that setting, copy the install code again and paste it in the plugin settings.

= What is a site key? =

A site key is one line of text that begins with `oxvo_site_v1`. It holds the public details from your install code, such as the AI Guide installation key, the Insights website address and the Messenger website token. It does not hold passwords or secret keys. When you save, the plugin converts the install code into a site key in your browser. You can also paste a site key directly.

= Insights does not collect data. What can I check? =

When the site key names a website address, Insights only collects data on that address. When your site address is different, for example on a staging site, the status panel shows a warning. Use the installation code for that address from OXVO Console. If you use a consent plugin with the WP Consent API, Insights also waits until the WP Consent API reports that the visitor allows statistics.

= Does the plugin show a cookie banner? =

No. OXVO Connect does not add a cookie banner or a consent popup. If your consent plugin supports the WP Consent API, Insights starts only when the WP Consent API reports that the visitor allows statistics, and AI Guide records sessions only in that case. Without the WP Consent API, Insights starts when the page loads. Consent does not change whether AI Guide or Messenger loads.

= I already added AI Guide, Insights or the Messenger script to my theme. What happens? =

Remove the old code from your theme after you save your site key here. While the AI Guide install code is still on the page, the page still shows only one AI Guide. While the Messenger script is still on the page, the plugin does not load a second copy of Messenger. While another analytics setup of the same kind, such as another copy of OXVO Insights, already runs on the page, Insights from this plugin stays off, and the browser console says why.

= Why does Messenger not show on my site? =

Your site shows one chat at a time. When your site key includes AI Guide and AI Guide is on, Messenger does not load, and the status panel says so. To show Messenger instead, turn off AI Guide in Settings, OXVO Connect. If the Messenger script is also in your theme, remove it there, or visitors can see both chats.

= How does "Identify users" work? =

Turn on "Identify users" and save your identity validation secret key from your Messenger settings in OXVO Console. Logged-in users are then identified in Messenger with their name, email address and WordPress user ID. The plugin signs the user ID with HMAC-SHA256 on your server, and the secret key is never added to your pages.

= Can developers change what loads? =

Yes. The plugin has two filters:

* `oxvo_connect_site_key` filters the site key that is printed on the page. Return an empty string to load nothing on that page. When the key you return has both AI Guide and Messenger, the plugin removes Messenger from it.
* `oxvo_connect_identify` filters the attributes that are sent to Messenger for the logged-in user. It receives the attributes (`name`, `email` and `identifier_hash`) and the `WP_User` object.

In the browser, `window.OxvoConnect.getState()` returns the current state of AI Guide, AI Guide session recording, Insights and Messenger. `window.OxvoConnect.setAnalyticsConsent( true )` or `window.OxvoConnect.setAnalyticsConsent( false )` passes a consent decision to Insights.

= Where can I get help? =

Visit [oxvo.com/support](https://oxvo.com/support) or email info@oxvo.com.

== External services ==

This plugin connects your site to services from OXVO ([oxvo.com](https://oxvo.com)). An OXVO account is required. Nothing loads and no data is sent until an administrator saves a site key in Settings, OXVO Connect. The plugin does not send requests from your server. Your visitors' browsers send the requests below, and only for the features that are on. As with any web request, OXVO receives the visitor's IP address and browser information.

**api.oxvo.com** serves the OXVO AI Guide scripts and runs AI Guide. If your site key names another oxvo.com address for AI Guide, AI Guide uses that address instead.

**static.oxvo.com** serves the OXVO Insights and OXVO Messenger scripts.

**app.oxvo.com** runs the analytics and chat services. If your site key names another oxvo.com address, the Messenger script and the services use that address instead.

* AI Guide, when it is on: the AI Guide script loads from OXVO on each page view and sends OXVO the AI Guide installation key, the page path without its query string, and the browser language. When a visitor uses AI Guide, the address of the page they are on is sent to OXVO, and their messages go from their browser to the AI provider that OXVO uses to generate the answers. When a visitor talks to AI Guide by voice, their microphone audio is streamed from their browser to that AI provider. Depending on your AI Guide settings and the visitor's choices, AI Guide also uses a description of the page to answer, such as its title, its visible text and the labels of its buttons, links and fields, and, if the visitor agrees, a simplified image of the page layout. It does not send what visitors type into forms on the page. AI Guide keeps identifiers and the current conversation in the visitor's browser storage, and it sets no cookies.
* AI Guide session recording, when your site key includes it: recording starts only after the visitor turns it on in AI Guide. With a consent plugin that supports the WP Consent API, it also needs the WP Consent API to report that the visitor allows statistics when the page loads. Session recording records the page and the visitor's activity on it, such as mouse movement, clicks, scrolling and text selection, as well as browser console messages and errors, and sends them to OXVO for replay. Text that visitors type into fields is masked.
* Insights, when it is on: the Insights script loads from OXVO on each page view. Page views and interactions on your site are sent to OXVO while visitors browse, as configured in your OXVO account. When the site key names a website address, Insights sends data only from that address. With a consent plugin that supports the WP Consent API, Insights sends data only after the WP Consent API reports that the visitor allows statistics.
* Messenger, when it is on: the chat window loads from OXVO on each page view. When a visitor uses the chat, their messages and any details they share in the chat are sent to OXVO. When "Identify users" is on, the name, email address and WordPress user ID of a logged-in user, with a signed hash of the user ID, are sent to OXVO when the chat loads.

OXVO terms and conditions: [https://oxvo.com/company/terms-conditions](https://oxvo.com/company/terms-conditions)

OXVO privacy policy: [https://oxvo.com/company/privacy-policy](https://oxvo.com/company/privacy-policy)

== Screenshots ==

1. OXVO AI Guide answering a visitor's question on a website.
2. The settings page, where you paste the install code from OXVO Console.
3. The status panel, which shows what your site key turns on.
4. OXVO Messenger on a website.

== Changelog ==

= 1.1.2 =
* Your site now shows one chat at a time. While AI Guide is on, Messenger does not load, and the status panel and the settings preview say so. Turn off AI Guide to show Messenger.
* Updates the OXVO Connect loader to version 1.1.15.

= 1.1.1 =
* When AI Guide and Messenger are both on, the Messenger chat button now sits above AI Guide, so visitors can open both.
* Updates the OXVO Connect loader to version 1.1.1.

= 1.1.0 =
* Adds OXVO AI Guide. Paste the AI Guide install code from OXVO Console, and the site key adds AI Guide to your site.
* AI Guide session recording follows the WP Consent API, as Insights does. With the WP Consent API, the plugin loads its script with defer instead of async, so the script starts with the visitor's choice.
* Adds a setting to turn AI Guide off.
* The settings page and the status panel list AI Guide first, then Insights, then Messenger.
* Updates the OXVO Connect loader to version 1.1.0.

= 1.0.0 =
* First release. Adds OXVO Messenger and OXVO Insights with one site key, lets you turn each one off, identifies logged-in users in Messenger, and follows the WP Consent API for Insights.

== Upgrade Notice ==

= 1.1.2 =
While AI Guide is on, Messenger no longer loads, so your site shows one chat at a time.

= 1.1.1 =
AI Guide no longer covers the Messenger chat button when both are on.

= 1.1.0 =
Adds OXVO AI Guide, an AI assistant for your visitors.

= 1.0.0 =
First release.
