=== Paid Memberships Pro - Google Analytics Integration ===
Contributors: strangerstudios, andrewza
Tags: paid memberships pro, pmpro, google analytics, analytics, ga4, conversions
Requires at least: 5.2
Tested up to: 7.1
Stable tag: 1.0.4

Connect Paid Memberships Pro to Google Analytics 4 to measure traffic, interactions, and ecommerce conversions across your membership site.

== Description ==

This plugin connects your membership site to Google Analytics to measure traffic and interactions across your website, as well as ecommerce conversions (new memberships and subscriptions) across the checkout experience.

Google Analytics Integration for Paid Memberships Pro includes full GA4 integration. With this plugin active, you do not need to use any other Google Analytics plugins (e.g. Monster Insights or Google Site Kit).

== Installation ==

= Prerequisites =
1. You must have Paid Memberships Pro installed and activated on your site.

= Download, Install and Activate! =
1. Download the latest version of the plugin.
1. Unzip the downloaded file to your computer.
1. Upload the /pmpro-google-analytics/ directory to the /wp-content/plugins/ directory of your site.
1. Activate the plugin through the 'Plugins' menu in WordPress.

= How to Use =
1. Navigate to Settings > PMPro Google Analytics.
1. Enter your Google Analytics Property's Measurement ID 
1. Define settings for membership levels to track (including free checkouts) or leave blank to track all ecommerce conversions.
1. Optionally exclude administrator role users from tracking.
1. Save Settings.

View full documentation at: https://www.paidmembershipspro.com/add-ons/google-analytics/

== Changelog ==
= 1.0.4 - 2026-10-01 =
* SECURITY: Improved sanitization and escaping throughout the plugin to resolve Plugin Check security findings. #10 (@dparker1005)
* BUG FIX: Fixed custom dimension and user property values containing a backslash breaking the Google Analytics config script. These values are now escaped for JavaScript instead of as HTML attributes. #10 (@dparker1005)
* BUG FIX: Fixed attributes added with the `pmproga4_script_atts` filter having their quotes HTML-encoded, which broke cookie consent integrations that rely on this filter. #10 (@dparker1005)

= 1.0.3 - 2026-05-05 =
* BUG FIX: Added a null check for the global `$pmpro_level` in `pmproga4_checkout_events()` to prevent fatal errors when the membership level is not set on the checkout page (e.g. direct page access or third-party plugin interference). #9 (@flintfromthebasement)

= 1.0.2 - 2026-01-20 =
* BUG FIX: Fixed a compatibility issue with LearnDash causing infinte loop when viewing lessons while in "focus mode". #8 (@andrewlimaza, @bernier-db)

= 1.0.1 - 2024-03-12 =
* BUG FIX: Fixed an issue where the user ID wasn't being passed to Analytics correctly for logged-in users. (@dwanjuki)

= 1.0 - 2023-10-23 =
* Initial release.
