=== GeoVisit Analytics ===
Contributors: onebizness
Tags: analytics, geolocation, woocommerce, marketing, utm
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your site to GeoVisit for geographic traffic, campaign, link, QR and ecommerce analytics.

== Description ==

GeoVisit Analytics connects a WordPress site to the external GeoVisit analytics service without editing the active theme or manually inserting the tracking script.

A GeoVisit account and project are required. After the site owner explicitly connects the plugin with the private WordPress connection key, the plugin can load the GeoVisit tracker on public pages and show a compact 30-day analytics summary inside WordPress.

If WooCommerce is active, the same plugin can also record ecommerce events such as product views, add-to-cart, checkout start and completed purchases. It does not send the buyer's name, email, postal address, telephone number or payment-card details to GeoVisit.

Features:

* Automatically loads the GeoVisit tracker on public pages after connection and authorization.
* Exclude WordPress administrators and/or logged-in users from tracking.
* Detects WooCommerce automatically.
* WooCommerce events: product view, add to cart, checkout start and purchase.
* 30-day summary inside WordPress: visits, estimated daily visitors, tracked clicks, top city, traffic source and campaign.
* WooCommerce summary: purchases, conversion rate and recorded revenue.
* Connection test from the WordPress administration screen.
* Compatible with WooCommerce HPOS and Cart/Checkout Blocks.
* No theme editing and no manually pasted script when the plugin method is used.

The complete analytics dashboard, maps, GeoOpportunity, campaign reports and shared reports remain available in the GeoVisit SaaS dashboard.

== External service ==

This plugin depends on the GeoVisit SaaS service operated by OneBizness at:
https://onebizness.com/geovisit/

The plugin does not contact GeoVisit until the site owner configures a GeoVisit project and authorizes the external-service connection in the plugin settings. Existing installations that were already explicitly connected remain connected after updating.

When connected, the plugin may communicate with these GeoVisit service endpoints:

* `https://onebizness.com/geovisit/tracker.js` — frontend analytics tracker.
* `https://onebizness.com/geovisit/api/collect.php` — web analytics events sent by the tracker.
* `https://onebizness.com/geovisit/api/event.php` — WooCommerce analytics events.
* `https://onebizness.com/geovisit/api/plugin_check.php` — validates the private WordPress connection key and returns the public tracker key.
* `https://onebizness.com/geovisit/api/plugin_stats.php` — returns aggregated project statistics to the WordPress admin screen.

Depending on the enabled features, data sent to GeoVisit may include page URL and title, referrer, UTM parameters, language, timezone, screen/platform information and technical request information such as the visitor IP address received by the GeoVisit server. GeoVisit uses the IP address to derive approximate geographic information and its service is designed not to retain the full IP address as a visit field.

When WooCommerce tracking is enabled, events may additionally include product ID/name, product value, quantity, currency, a non-reversible order identifier hash and order total. The plugin does not send buyer name, email, address, telephone or payment-card information to GeoVisit.

GeoVisit is a separate SaaS product and may offer trial and paid service plans. All PHP/JavaScript code shipped inside this WordPress plugin is available under the plugin license; service-plan limitations are enforced by the external GeoVisit service, not by hiding or unlocking plugin code.

GeoVisit Privacy Policy:
https://onebizness.com/geovisit/privacy.php

GeoVisit Terms of Service:
https://onebizness.com/geovisit/terms.php

== Privacy ==

Connecting the plugin causes site analytics data to be processed by the external GeoVisit service. The plugin adds suggested GeoVisit wording to WordPress' Privacy Policy Guide so the site owner can review and adapt the site's own privacy notice.

The site owner is responsible for determining the legal basis, notice and consent requirements that apply to analytics on their website. This plugin does not claim to make a website automatically compliant with privacy law.

== Installation ==

1. Upload the plugin ZIP from `Plugins > Add Plugin > Upload Plugin`, or install it from the WordPress Plugin Directory when available.
2. Activate **GeoVisit Analytics**.
3. Open **GeoVisit** in the WordPress admin menu.
4. In your GeoVisit SaaS account, open the project and choose **Install tracker > WordPress / WooCommerce**.
5. Copy the **WordPress connection key** (`wp_...`). Do not paste the full tracking script into the plugin.
6. Paste the key into the plugin settings.
7. Review the external-service information, authorize the GeoVisit connection, and click **Save and connect**.
8. Click **Check connection**.

Use either the WordPress plugin or the manual tracking script on the same site, not both, to avoid duplicate pageviews.

== Frequently Asked Questions ==

= Do I need a GeoVisit account? =

Yes. The plugin is a client for the GeoVisit SaaS service and requires a GeoVisit project and its private WordPress connection key.

= Do I paste the GeoVisit tracking script into the plugin? =

No. Paste only the private **WordPress connection key** shown by GeoVisit in the WordPress / WooCommerce installation method.

= Does the plugin work without WooCommerce? =

Yes. It works as a normal WordPress analytics integration. WooCommerce features are enabled only when WooCommerce is detected and the ecommerce option is enabled.

= Does GeoVisit receive customer personal details from WooCommerce orders? =

The plugin is designed not to send buyer name, email, postal address, telephone number or payment-card data. Ecommerce events contain technical/product and aggregate transaction information needed for analytics.

= Can I exclude my own WordPress visits? =

Yes. Administrators are excluded by default. You can also exclude all logged-in users from the plugin settings. GeoVisit itself additionally provides IP/device traffic-exclusion controls in the SaaS dashboard.

= Does this plugin guarantee GDPR or privacy-law compliance? =

No. Privacy requirements vary by site, jurisdiction and configuration. Review your legal obligations and update your privacy notice as appropriate.

== Changelog ==

= 1.1.5 =
* Added an explicit version parameter to every enqueued JavaScript resource, including the remote GeoVisit tracker, so updated scripts are not retained by browser caches.
* Resolves the `WordPress.WP.EnqueuedResourceParameters.MissingVersion` Plugin Check warning.
* No changes to existing GeoVisit project data or analytics configuration.

= 1.1.4 =
* Ensured the GeoVisit frontend tracker is only output through WordPress' script enqueue system; the project attribute is now added to the enqueued tag with the WordPress HTML Tag Processor.
* Removed direct `$_GET` processing from the WooCommerce order-received flow.
* Raised the minimum WordPress version to 6.2 because the plugin now uses the core `WP_HTML_Tag_Processor` API.
* No changes to existing GeoVisit project data or analytics configuration.

= 1.1.3 =
* Aligned the plugin text domain and package slug with `geovisit-analytics` for WordPress.org validation.
* Renamed the plugin package directory/main file to match the expected WordPress.org slug.
* No analytics behavior changes.

= 1.1.2 =
* Renamed the plugin to **GeoVisit Analytics** to comply with WordPress.org trademark and naming requirements.
* Kept WordPress and WooCommerce compatibility in the plugin description rather than the display name.
* Updated submission metadata without changing analytics behavior.

= 1.1.1 =
* Added GPL license metadata and a WordPress.org-ready readme.
* Documented the GeoVisit external SaaS service, endpoints and data flows.
* Added explicit external-service authorization for new connections.
* Added suggested GeoVisit text to the WordPress Privacy Policy Guide.
* Fixed wording around the private WordPress connection key.
* Hardened outbound admin requests with WordPress safe HTTP requests.
* Updated compatibility metadata for WordPress 7.1.

= 1.1.0 =
* Added the private WordPress connection key.
* Added a 30-day GeoVisit statistics summary inside WordPress.
* Improved separation between the manual web tracker and the WordPress plugin method.

= 1.0.1 =
* Improved instructions for locating and copying the GeoVisit project connection key.
* Clarified that the full tracking script must not be pasted into the key field.

= 1.0.0 =
* Initial release with WordPress tracking and automatic WooCommerce event support.

== Upgrade Notice ==

= 1.1.5 =
Adds explicit resource versioning to the enqueued GeoVisit tracker and resolves the WordPress.org missing-version warning.

= 1.1.4 =
Resolves WordPress.org Plugin Check warnings related to script output and direct request-variable processing.

= 1.1.3 =
Aligns the plugin text domain and package slug with `geovisit-analytics` for WordPress.org validation. No analytics data or project configuration is changed.

= 1.1.2 =
Renames the plugin to GeoVisit Analytics for WordPress.org naming compliance without changing your GeoVisit project data.

= 1.1.1 =
Adds clearer privacy/external-service disclosure and WordPress.org submission metadata without changing your GeoVisit project data.
