=== Vestige Metrics ===
Contributors: salvachz
Tags: analytics, tracking, pixel, attribution, conversions
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to Vestige Metrics and understand which campaigns turn visits into leads and sales.

Vestige Metrics gives your team a clearer view of the customer journey — from the first campaign click to the final conversion. Install the tracking pixel in a few steps, without editing your theme or code.

**Requires an active Vestige Metrics account.**

== Description ==

Vestige Metrics helps businesses analyze acquisition journeys by connecting traffic, campaign, lead, and sales data.

This plugin connects a WordPress site to a Vestige Metrics account. After an administrator signs in and selects an account, the plugin adds the Vestige Metrics tracking script to the public pages of the site.

An active Vestige Metrics account is required. The plugin does not display advertising, add public credits, or contact Vestige Metrics until an administrator chooses to connect an account.

== Why Vestige Metrics? ==

* **One-click connection:** authenticate securely with your Vestige Metrics account using OAuth.
* **No theme editing:** the tracking pixel is installed automatically after you select an account.
* **Campaign visibility:** preserve campaign and attribution context across the customer journey.
* **Simple status:** see at a glance whether tracking is connected and configured.
* **Control when tracking starts:** the script loads only after an administrator connects an account and selects it.

== Features ==

* OAuth connection to Vestige Metrics.
* Synchronization and selection of available Vestige Metrics accounts.
* Automatic installation of the tracking pixel after an account is selected.
* A local status indicator showing whether the pixel is configured.

== Getting started ==

1. Install and activate the plugin.
2. Open **Vestige Metrics** in the WordPress administration menu.
3. Click **Connect to Vestige Metrics** and authorize the connection.
4. Select the account that should receive this site's tracking data.
5. Publish your site and monitor your acquisition journey in Vestige Metrics.

No code changes are required.

== Screenshots ==

1. The Vestige Metrics capture dashboard brings investment, visits, leads, conversion, CPL, UTM sources, and pages into one view.

== Privacy and external services ==

Vestige Metrics contacts its external services only when an administrator starts the connection flow. After an account is selected, the tracking service may process page views, campaign parameters, referrers, browser and device information, network information, and tracking identifiers, depending on your configuration.

See the [Vestige Metrics Privacy Policy](https://vestigemetrics.com.br/politica-de-privacidade/) and [Terms of Use](https://vestigemetrics.com.br/termos-de-uso/) for details.

== External services ==

This plugin relies on the Vestige Metrics software-as-a-service platform to authenticate administrators, retrieve their available accounts, and provide analytics and attribution tracking.

= Authentication and account synchronization =

When an administrator clicks "Connect to Vestige Metrics", the browser is sent to `https://app.vestigemetrics.com.br/oauth/login-screen` together with a callback URL for the WordPress administration area. Authentication takes place on the Vestige Metrics domain.

After authorization, Vestige Metrics returns an authorization code to the callback URL. The plugin stores that code in the WordPress options table as an access token. When the plugin settings page is opened or the administrator requests account synchronization, the token is sent in an authorization header to `https://app.vestigemetrics.com.br/api/v1/cf-oauth-info/`. The service returns the identifiers and names of the Vestige Metrics accounts available to that user.

This communication occurs only after an administrator explicitly starts the connection process. WordPress passwords are not sent to Vestige Metrics.

= Tracking service =

After an administrator selects an account, the plugin loads an account-specific JavaScript file from `https://tag.ltrck.com.br/` on public pages. The account identifier is included in the script URL.

The tracking service processes visitor and page-view information for analytics and attribution. Depending on the page and Vestige Metrics configuration, this can include the page URL, referrer, query parameters such as UTMs and LTMs, browser and device information, network information such as the IP address, tracking identifiers stored in the browser, and events explicitly configured by the site owner.

The tracking script is not loaded until an administrator connects Vestige Metrics and selects an account. Disconnecting the account stops the plugin from loading the script.

The external services are provided by Vestige Metrics and are subject to its terms and privacy policy:

* [Vestige Metrics website](https://vestigemetrics.com.br/)
* [Vestige Metrics documentation](https://docs.vestigemetrics.com.br/help/)

== Installation ==

1. Upload the `vestige-metrics` folder to `/wp-content/plugins/`, or install the plugin ZIP file from the WordPress Plugins screen.
2. Activate Vestige Metrics.
3. Open Vestige Metrics in the WordPress administration menu.
4. Connect a Vestige Metrics account.
5. Select the account that should be used for tracking and save the selection.

== Frequently Asked Questions ==

= Is a Vestige Metrics account required? =

Yes. An account is required to authenticate the plugin and select the tracking account for the site.

= When does the plugin contact external services? =

The authentication and account endpoints are contacted after an administrator chooses to connect an account. The tracking script is loaded on public pages only after an account has been selected.

= Does deactivating the plugin remove its settings? =

No. Account settings are preserved when the plugin is deactivated. Deleting the plugin removes the stored token, account selection, and temporary OAuth verification data. You can also remove the token and account selection before deactivation by using the Disconnect action on the plugin settings page.

= Where can I learn more about tracking and integrations? =

See the [Vestige Metrics documentation](https://docs.vestigemetrics.com.br/help/).

== Changelog ==

= 1.0.0 =
* Initial Vestige Metrics release with OAuth connection and automatic tracking setup.
