=== Joinchat ===
Contributors: creapuntome, pacotole, davidlillo, monillo
Donate link: https://join.chat/donate/
Tags: WhatsApp, Chat, Floating Button, Facebook Messenger, Telegram
Requires at least: 4.9.6
Tested up to: 6.8
Requires PHP: 7.0
Stable tag: 6.0.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

WhatsApp, Messenger, Telegram, Phone call… capture users through their favorite Apps and turn into clients


== Description ==

> **Turn conversations into conversions**

**🎉 Chat with your website visitors through their favorite chat applications. Place a floating contact button at the bottom of your site and give the best support to your customers.**

[Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web) | [**Joinchat Premium**](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web) | [**Joinchat AI ✨**](https://join.chat/en/ai/?utm_source=wporg&utm_medium=web)

### ⌁ What you can do with Joinchat ✅

### 🛎 Insert a contact button for WhatsApp on your website.
Set your ‘WhatsApp’ or ‘WhatsApp Business’ number and let your visitors contact you easily:

🧩 **WhatsApp Contact Button Block** with optional QR Code

📱 On mobile, launch WhatsApp mobile app

💻 On desktop, launch WhatsApp desktop app or WhatsApp Web

🤳 On desktop, **show QR Code** to scan from phone

Customize your logo, profile picture or even an animated gif.

Define in which pages or zones it should appear, the delay time, if you want it to the right or to the left, only on mobile phones or also on the desktop.

You can define a tooltip or a call to action to capture the user's interest, the limit is set by your creativity.

### 📢 New on Joinchat 6.0

* Enhance your CTAs with **Rich Chat**: multiple chat bubbles, include links or buttons, add images and use random texts.
* **Improved performance**: vanilla JavaScript without any dependency and lazy loading of styles and scripts.
* **New button icons** and allows to keep the alternative image fixed.
* Integration with new **WooCommerce brands**.
* Other optimizations: refactor and improved styles, updated phone input (37 translations included), added **{HOME}** variable, etc.

### 📝 Settings at page or archive level.
You can **change main settings on every Post, Page, Product or CPT and for Tag or Category archive pages**.

Editing your posts in the right side in the Joinchat metabox or editing your tags or categories in the Joinchat section, you can modify Phone, CTA, Start Message and Visibility options.

### 🔴 Show a notification.
Use a balloon on the button to get the visitor's attention.

In this way, you ensure that you do not miss any important message you want to give them, surprise them in a less intrusive way.

### 📯 Create call-to-action messages.
To get users to start the chat, use custom CTAs on each page, product or section.

Welcome them, help them and offer them offers or promotions. [Read more](https://join.chat/es/joinchat-mucho-mas-que-un-click-to-chat/?utm_source=wporg&utm_medium=web)

### 💬 Customize conversation start messages.
Set the first message so that the visitor can start the conversation immediately.

Use our "Dynamic Variables" and you will know what page the visitor is coming from or what product they are looking at when they start the chat.

### ✅ Opt-in text.
Opt-in is a users' consent to receive messages from a business.

Write a text with the conditions under which the visitor contacts you (or other info that you consider important).

You can make it mandatory and disable contact until the user accepts it.

### 🛒 Integration with WooCommerce.
Define CTAs and Custom Start Messages for shop page, product pages and for products on sale.

Add a **WhatsApp Contact Button** directly on your product page next to the "Add to cart" button or choose the best position, even on products without a price.

### 🧩 WhatsApp Contact Button Block (min WP 5.9).
Add beautiful and customizable WhatsApp contact buttons in the Block Editor.

Ready to use patterns with different styles are also included.

Enable QR Code on desktop to allow your visitors to scan it and start messaging from their phone.

You can define phone and initial message of the button or use the post/general Joinchat settings (ideal for Reusable Blocks).

### 🃏 Dynamic Variables.
Use variables in your CTAs and Start Messages that change dynamically for each page:

**{SITE}** ➡ Website title
**{TITLE}** ➡ Current page title
**{HOME}** ➡ Website home url
**{URL}** ➡ Current page url
**{HREF}** ➡ Current page url (full with query params)
**{PRODUCT}** ➡ Product name (Woo)
**{SKU}** ➡ Product SKU (Woo)
**{REGULAR}** ➡ Product regular price (Woo)
**{PRICE}** ➡ Product current price (Woo)
**{DISCOUNT}** ➡ Product percent discount when is on sale (Woo)

### 📈 Analytics Integration.
Automatically send events to **Google Analytics, Google Tag Manager and Facebook Pixel** when the user opens WhatsApp.

Now can **send events to multiple destinations** on Google Tag!

**Google Analytics 4** integration with the recommended `"generate_lead"` event.

**Google Ads** conversion, just add your Conversion ID and Conversion Label.

You can also **create your own custom events or add event parameters**. [View FAQs](https://wordpress.org/plugins/creame-whatsapp-me/faq/) / [Read more](https://join.chat/en/joinchat-measures-whatsapp-events-in-google-analytics/?utm_source=wporg&utm_medium=web)

### 🍾 Chat Triggers.
Any element in your page can be a chat trigger, eg: it can launch WhatsApp from a link or show the Joinchat CTA when the user scrolls to the footer.

**On page load (by url):**

* url query param `joinchat` to show chat window. Can set delay in seconds, default is 0 *(e.g. example.com/page/?joinchat=5)*
* url query hash `#joinchat` to show chat window *(e.g. example.com/page/#joinchat)*

**On click:**

* class `"joinchat_app"` direct launch WhatsApp
* class `"joinchat_open"` opens Joinchat CTA
* link href `"#whatsapp"` direct launch WhatsApp
* link href `"#joinchat"` opens Joinchat CTA

Set **custom phone and initial message** for direct WhatsApp triggers:

* `data-phone="99999999"`
* `data-message="Only for this trigger message"`.

**On scroll (when element appears on screen):**

* class `"joinchat_show"` opens Joinchat CTA (first time)
* class `"joinchat_force_show"` opens Joinchat CTA (always)

### 💱 Multi-Language & RTL Support.
To be able to support all your users, wherever they are. Our plugin is **compatible with WPML and Polylang** and also **RTL languages** are supported.

**Direct link to edit translations** when a translatable field is changed.

### 🌈 Theme Colors & 🌚 Dark Mode.
You choose a color and we customize the entire visual theme of the widget. With Dark Mode display the chat window with dark colors and white text. From settings you can activate it or leave it automatic and detects devices' configuration.

### ⚡ Fast & Light.
Only load what need when needed. Joinchat is lightweight and follow best coding practices. [See tests report](https://wphive.com/plugins/creame-whatsapp-me/)

Use vanilla **JavaScript without dependencies**, deferred scripts and lazy load of styles to **prevent render-blocking**.

### 🔕 No distractions.
Joinchat integrates with all major Visual Editors and Page Builders and will not appear when editing a page.

Supported editors: **Beaver Builder**, **Brizy Page Builder**, **Elementor**, **Oxygen Builder**, **Page Builder by SiteOrigin**, **Thrive Architect**, **Visual Composer** and **WP Page Builder**.

### 🍪 Cookies & GDPR.

**Joinchat can be used without any cookies**. But to automatically display the CTA, two cookies are necessary. They are first-party cookies and don't collect personal data.

Joinchat integrates with *Wordpress's Privacy Policy Guide* and suggests the necessary text.

### 👨‍💻 Developer friendly.
Fully extensible, with lots of filters and actions to extend its functionality or change behavior.

### === **Joinchat Premium** 🚀 ===
Turn your chat into a powerful lead capture and support tool.

* **Create chatbot-like conversation flows** to capture leads and automate replies.
* **Manage multiple agents and schedules** to organize support.
* **Prevent overload** by distributing chats across multiple WhatsApp numbers.
* **Add more channels** like Telegram, Messenger, or phone calls.
* **Boost conversions** with videos, surveys, and more right inside the chat window.

[👉 **Get Joinchat Premium**](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web) and upgrade your support today.

### === **Joinchat AI** ✨ ===
Supercharge your chat with AI-powered instant replies and smart support.

* **Answer instantly 24/7** using AI trained on your FAQs and website content.
* **Guide visitors and solve questions automatically** without human intervention.
* **Reduce workload and boost efficiency** by handling repetitive queries.
* **Keep control** with easy knowledge base management and response customization.

[👉 **Get Joinchat AI**](https://join.chat/en/ai/?utm_source=wporg&utm_medium=web) and let AI handle the hard work.

### 🎨 "Business Chat" is our WordPress theme recommended
**Business Chat** is a versatile WordPress theme designed for businesses seeking a professional online presence. It offers a fully responsive design, built-in SEO tools, extensive customization options, and a chat integration through Joinchat. It's compatible with popular page builders and backed by dedicated customer support. Also it's the ultimate solution for a high-performing, user-friendly business website.

**Business Chat** offers both a [free](https://wordpress.org/themes/business-chat/) and a [premium version](https://superbthemes.com/business-chat/), catering to businesses with varying budgets and requirements. This flexibility makes it an ideal choice for businesses looking for a comprehensive and versatile solution to establish their online presence.

### ⌁ If you like Joinchat 😍
1. Please leave us a [★★★★★](https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post) rating. We'll thank you.
2. Help us with the [translation in your language](https://translate.wordpress.org/projects/wp-plugins/creame-whatsapp-me)
3. Visit our blog and find tips and tricks at [join.chat](https://join.chat/en/blog/?utm_source=wporg&utm_medium=web).
4. Follow [@joinchatnow](https://x.com/joinchatnow) on X. Join chat now!


== Installation ==

1. Upload the entire `creame-whatsapp-me` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.


== Frequently Asked Questions ==

= I can't see the button or it's over / under another thing =

You can change the position of the button so that nothing covers it by adding this CSS in *Joinchat Settings > Advanced > Custom CSS*:

`.joinchat { z-index:999999; }`

Higher values of z-index are above, the default value is 9000.

If you need to move up:

`/* always */
.joinchat { --bottom: 60px; }

/* mobile only */
@media (max-width: 480px), (orientation: landscape) and (max-height: 480px) {
  .joinchat { --bottom: 60px; }
}`

= Change button size =

You can change the button size by adding this CSS in *Joinchat Settings > Advanced > Custom CSS*:

`/* always */
.joinchat { --s: 50px; }

/* mobile only */
@media (max-width: 480px), (orientation: landscape) and (max-height: 480px) {
  .joinchat { --s: 40px; }
}`

For WooCommerce Product Button you can change size with:

`.joinchat__woo-btn { --s: 50px; }`


= Shortcodes / Triggers =

Joinchat does not provide any shortcodes, but you can easily link to WhatsApp in two ways:

1. Add an anchor link to `#whatsapp` (open WhastApp directly) or `#joinchat` (show chat window).<br>e.g.: add in your menu a custom link with the URL `#whatsapp`
2. Add a css class to any element, `joinchat_app` (open WhastApp directly) or `joinchat_open` (show chat window).<br>e.g.: `<img src="contact.jpg" class="joinchat_open" alt="Contact">`

This works with your phone settings and message with dynamic variables, **even on pages without Joinchat visible**.

For custom direct WhatsApp links you can add `data-phone` and `data-message` attributes.<br>e.g.: `<a href="#whatsapp" data-phone="99999999" data-message="I want to chat">Chat now!</a>`

= Disable enhanced telephone input =

Joinchat uses International Telephone Input library to facilitate and validate the introduction of the phone number in the format of each country. If you have problems with your phone number or you want to write it directly without any changes you can disable it with this filter *(remember follow [WhatsApp guidelines](https://faq.whatsapp.com/general/contacts/how-to-add-an-international-phone-number))*:

`add_filter( 'joinchat_enhanced_phone', '__return_false' );`

= Allow other roles to change settings =

By default Joinchat settings can only be edited by users with `manage_options` capability (administrator).
You can change the required capability with the filter `"joinchat_capability"`.

`// e.g. allow shop managers:
add_filter( 'joinchat_capability', function(){ return 'manage_woocommerce'; } );

// e.g. allow editors:
add_filter( 'joinchat_capability', function(){ return 'edit_pages'; } );`

Since v4.4 Joinchat menu is placed as direct menu in your wp-admin but you can change it with the filter `"joinchat_submenu"`:

`// Show as submenu under Settings (also require "manage_options" capability)
add_filter( 'joinchat_submenu', '__return_true' );`

= Disable Gutenberg sidebar =

The block editor evolves quickly and errors can occur that we have not anticipated.

If you have any errors with Gutenberg and Joinchat or simply prefer the old Joinchat metabox you can use this filter:

`add_filter( 'joinchat_gutenberg_sidebar', '__return_false' );`

= WPML/Polylang translations =

Joinchat settings are saved in your site's main language. For other languages translation go to *WPML/Polylang Settings > String translations*, filter strings group by "Joinchat" and update the strings for each language.

= Google Tag with multiple destinations =

Joinchat since 5.1 can detect multiple destinations in Google Tag and send events to all of them.

= Google Analytics 4 integration =

Joinchat sends a custom event when user launch WhatsApp.

If Google Analytics 4 (gtag.js) is detected, use the recommended `'generate_lead'` event:

`gtag('event', 'generate_lead', {
    event_category: 'JoinChat',
    event_action: 'whatsapp: 99999999999',
    event_label: destination_url,
    chat_channel: 'whatsapp',
    chat_id: '99999999999',
    is_mobile: 'yes' | 'no',
});`

If your site don't have standard names for data layer ('dataLayer') you can set your custom names with this PHP filter. **Also can set a different event name for GA4**:

`add_filter( 'joinchat_get_settings', function( $settings ){
    $settings['ga_event'] = 'myGA4Event';
    $settings['data_layer'] = 'dataLayerCustom';
    return $settings;
} );`

Joinchat is compatible with plugins **MonsterInsights – Google Analytics Dashboard for WordPress** and **Google Tag Manager for WordPress** custom names.

= Google Tag Manager integration =

Joinchat sends a `'JoinChat'` event if GTM is detected when user launch WhatsApp:

`dataLayer.push({
    event: 'JoinChat',
    event_action: 'whatsapp: 99999999999',
    event_label: destination_url,
    chat_channel: 'whatsapp',
    chat_id: '99999999999',
    is_mobile: 'yes' | 'no',
    page_location: current_url,
    page_title: page_title,
});`

= Facebook Pixel integration =

Joinchat sends a `'JoinChat'` custom event if Facebook Pixel is detected when user launch WhatsApp:

`fbq('trackCustom', 'JoinChat', {
    event_action: 'whatsapp: 99999999999',
    event_label: destination_url,
    chat_channel: 'whatsapp',
    chat_id: '99999999999',
    is_mobile: 'yes' | 'no',
    page_location: current_url,
    page_title: page_title,
});`

= Custom Events / add Event Parameters =

Joinchat triggers custom events before launch WhatsApp `'joinchat:open'` and before send analytics events `'joinchat:event'`.

You can use them to extend them to your needs, add extra functions, cancel events or add extra parameters.

`// e.g.: Send webhook to Zapier
jQuery(document).on('joinchat:event', function (event, params) {
  jQuery.post('https://hooks.zapier.com/hooks/catch/123456/xxxxxx/', params );
});

// e.g.: Add user_is_logged param for GA4/GTM event
jQuery(document).on('joinchat:event', function (event, params) {
  params.user_is_logged = document.body.classList.contains('logged-in') ? 'yes' : 'no';
});`

= What about GDPR? =

**Joinchat can be used without any cookies**.

Depending on your Joinchat settings, two cookies may be needed. They are first-party cookies and don't collect personal data.

* `joinchat_views` is a visits counter to control when to show chat window.
* `joinchat_hashes` saves when a user has interacted with a CTA to prevent automatically show that CTA again.

You can view in your *Settings > Privacy > Policy Guide* the suggested text by Joinchat.


== Screenshots ==

1. Real example
2. Real example
3. Real example
4. Real example
5. Real example
6. Real example
7. Product Button example
8. General settings
9. Visibility settings
10. WooCommerce settings
11. Advanced settings
12. Page settings


== Changelog ==

= 6.0.6 =
* Aff a filter for Litespeed Cache plugin to ensure Joinchat JS/CSS assets version. Prevent Joinchat break layout if visitor has Joinchat v5 cached assets (thanks to @tendenzeshabbychic and @qtwrk).

= 6.0.5 =
* Fix CSS transparent background color if only floating button without chatbox.

= 6.0.4 =
* Fix some js conflicts in wp-admin if other plugins adds IntTelInput.

= 6.0.3 =
* Fix js error with variable product SKU.

= 6.0.2 =
* Bump min PHP version to 7.0.
* Add fallback to missing functions in older WordPress versions.
* Fix fatal error on old add-ons with missing class JoinchatUtil.
* Fix Woo product button styles.

= 6.0.1 =
* Fix hidden attribute can make button invible with some CSS resets (like Bootstrap).

= 6.0.0 =
* New **Rich Chat**: multiple chat bubbles with links, buttons, images and random texts.
* **Improved performance**: vanilla JavaScript without any dependency and lazy loading of styles and scripts.
* **New button icons** and allows to keep the alternative image fixed.
* Integration with new **WooCommerce brands**.
* Other optimizations: refactor and improved styles, updated phone input (37 translations included), added **{HOME}** variable, etc.

See [changelog.txt](https://plugins.svn.wordpress.org/creame-whatsapp-me/trunk/changelog.txt) for older changelog


== Upgrade Notice ==

**Joinchat 6** is a mayor version that includes refactored layout, styles and JavaScript. Please check your site after updating.
**Joinchat Premium users:** You need to upgrade to Joinchat Premium 6 for full compatibility.
