=== Liana with GrowthStack ===
Contributors: lianatechnologies
Tags: marketing automation, personalization, analytics, ab-testing, conversion optimization
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 2.0.13
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Add world class marketing automation features like personalization to your website.

== Description ==

Liana with GrowthStack is a powerful WordPress plugin that brings enterprise-level marketing automation and personalization capabilities to your website. Built by Liana Technologies, it seamlessly integrates with LianaAutomation to help you optimize conversions and deliver personalized experiences to your visitors.

= Key Features =

* **Content Personalization** - Show different content to different visitors based on various rules
* **Analytics & Insights** - Track page views, user behavior, and engagement metrics
* **Marketing Automation Forms** - Integrate LianaAutomation forms directly into your content
* **LianaMailer Integration** - Connect with Contact Form 7, Gravity Forms, and WPForms

= Pro Features =

Available in Pro version of the plugin.

* **A/B Testing** - Test different variations of your content to optimize conversions (available in Pro)
* **Audience Tracking** - Understand your visitors with detailed audience data
* **Advanced Personalization Rules** - Create more advanced personalization scenarios (available in Pro)

= Personalization Rules =

Create targeted content experiences based on:

* **Country** - Show content based on visitor's geographic location
* **Device Type** - Tailor content for desktop, tablet, or mobile users
* **Preferred Language** - Display content in the visitor's preferred language
* **Referrer** - Personalize based on where visitors came from
* **Time** - Show content based on time of day and day of the week
* **User Status** - Show content for new vs. returning visitors

= Analytics Features =

* Site-wide analytics with view counts, user counts, and session data
* Page-level performance metrics
* Engagement time tracking
* Audience insights including:
  * Traffic sources
  * New vs. returning visitors
  * Device types
  * UTM parameters (campaign, source, medium)

= Integrations =

* **LianaAutomation** - Full integration with marketing automation platform
* **LianaMailer** - Email marketing integration
* **Google Analytics** - Data Layer events of seen personalizations is sent and can be tracked in Google Analytics.

= Plugin compatibility =

* **Contact Form 7** - LianaMailer integration for form submissions
* **Gravity Forms** - LianaMailer integration for form submissions
* **WPForms** - LianaMailer integration for form submissions

= Caching and performance =

Liana with GrowthStack is compatible with popular caching plugins and server level caching solutions. It uses client-side JavaScript to handle content personalization and A/B testing, ensuring that cached pages still deliver dynamic content based on visitor data.

Analytics data is saved to the database in an optimized manner, with data being bundled and sent asynchronously to minimize performance impact. This does add some database load but write actions are done in asynchronously with JavaScript events to minimize impact on user experience.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/liana-with-growthstack` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. If you have Liana products, connect your LianaAutomation account in the Liana with GrowthStack settings.

= Minimum Requirements =

* WordPress 6.5 or greater
* PHP version 8.0 or greater
* MySQL version 5.7 or greater OR MariaDB version 10.3 or greater

== Frequently Asked Questions ==

= Do I need a LianaAutomation account? =

No, the plugin can be used standalone for basic personalization and analytics features.

= How does the personalization work? =

The plugin uses contextual data about your visitors (location, referrer, browsing history, etc.) to dynamically replace content blocks with personalized variations. This happens seamlessly without page refreshes but can have a slight delay.

= What blocks are compatible with personalization? =

Technically personalization replaces block content on the visible page using JavaScript. Most blocks work fine but some that add interactions or functionality with JavaScript might need to add handling in their JavaScript.

Blocks that require JavaScript might only hook their logic on DOMContentLoaded event and that might be too early for replaced content. In those cases the block developer needs to add support for Liana with GrowthStack personalization by re-initializing their JavaScript logic after Liana with GrowthStack has replaced the content (event GrowthstackReplacementDone on document).

= Does this plugin affect my site's performance? =

Liana with GrowthStack is optimized for performance. Analytics data is bundled and sent asynchronously, and content replacement happens efficiently on the client side. The plugin includes database query optimization and caching where appropriate. Analytics does add more database load but write actions are done in asynchronously with JavaScript events to minimize impact on user experience.

== Screenshots ==

1. Editing personalization variations in the block editor
2. Choosing personalization rules for a variation
3. Overview of all personalizations on the site
4. Local analytics of a page or site
5. Settings for Liana connectors

== Developer Hooks ==

Liana with GrowthStack provides various filters and actions for developers to customize functionality.

= Filters =

**Admin Capabilities**

Control who can access different admin pages:

* `growthstack/admin/capability/view_dashboard` - Capability required to view the dashboard (default: 'edit_pages')
* `growthstack/admin/capability/view_analytics` - Capability required to view analytics (default: 'edit_pages')
* `growthstack/admin/capability/view_personalization` - Capability required to view personalization (default: 'edit_pages')
* `growthstack/admin/capability/view_ab_tests` - Capability required to view A/B tests (default: 'edit_pages')
* `growthstack/admin/capability/view_forms` - Capability required to view forms (default: 'edit_pages')
* `growthstack/admin/capability/view_settings` - Capability required to view settings (default: 'manage_options')
* `growthstack/admin/capability/view_support` - Capability required to view support (default: 'manage_options')

**Admin UI**

* `growthstack/admin/submenu_pages` - Modify admin submenu pages array
* `growthstack/show_banner/upgrade` - Show/hide upgrade banner in Analytics (default: true)
* `growthstack/show_banner/ab_testing` - Show/hide banner in A/B Testing page (default: true)
* `growthstack/show_banner/audience` - Show/hide banner in Dashboard (default: true)

**Analytics**

* `growthstack/analytics/post_types` - Modify which post types are tracked for analytics (default: public post types)

**Personalization**

* `growthstack/rule_types` - Register or modify available personalization rule types
* `growthstack/personalization/visited_pages/post_types` - Modify post types available for "Visited Pages" personalization rule (default: ['post', 'page'])

**LianaMailer Integration**

Contact Form 7:

* `growthstack/lianamailer/contactform7/subscription_mailer_data` - Modify mailer data before sending
* `growthstack/lianamailer/contactform7/subscription_properties` - Modify contact properties
* `growthstack/lianamailer/contactform7/subscription_lists` - Modify selected mailing lists

Gravity Forms:

* `growthstack/lianamailer/gravityforms/subscription_mailer_data` - Modify mailer data before sending
* `growthstack/lianamailer/gravityforms/subscription_properties` - Modify contact properties
* `growthstack/lianamailer/gravityforms/subscription_lists` - Modify selected mailing lists

WPForms:

* `growthstack/lianamailer/wpforms/get_lianamailer_api` - Modify LianaMailer API instance
* `growthstack/lianamailer/wpforms/subscription_mailer_data` - Modify mailer data before sending
* `growthstack/lianamailer/wpforms/subscription_properties` - Modify contact properties
* `growthstack/lianamailer/wpforms/subscription_lists` - Modify selected mailing lists

= JavaScript Events =

Personalization:

* `GrowthstackReplacementDone` - Fired on document when personalization (or A/B testing) content replacement is complete

Example usage:
```javascript
document.addEventListener('GrowthstackReplacementDone', function(e) {
    // Re-initialize your JavaScript after content replacement
    console.log('Personalization applied');
});
```

Example double initialization for a hypothetical block:
```javascript
const INIT_EVENTS = {
	DOMContentLoaded: document,
	GrowthstackReplacementDone: document,
};

Object.entries( INIT_EVENTS ).forEach( ( [ event, element ] ) => {
	element.addEventListener( event, () => {
		init();
	} );
} );

const init = () => {
	const els = document.querySelectorAll( '.js-my-element-name' );
	els.forEach( ( el ) => {
		if ( 'true' === el.dataset.init ) {
			return;
		}
		el.dataset.init = 'true';
		setupElement( el );
	} );
};

const setupElement = ( el ) => {
	// Your block JavaScript logic here
};
```

== Changelog ==

= 2.0.13 / 2026-06-11 =
* Adds Cookiebot and CookieHub consent mode support for the GrowthStack cookies.

= 2.0.12 / 2026-06-01 =
* Adds CookieHub consent mode support for the LianaAutomation tracking script.

[See changelog for all versions](https://plugins.svn.wordpress.org/liana-with-growthstack/trunk/changelog.txt).

== Support ==

For support, feature requests, and bug reports, please visit:
* Website: https://www.lianatech.com/
* Documentation: https://www.lianatech.com/

== Credits ==

Liana with GrowthStack is developed and maintained by Liana Technologies.
