Google-Analytics

When the user clicks on the WhatsApp icon/button it creates an event at Google Analytics with some predefined values.

Plugin won’t install Google Analytics on its own.

Events Details:

If Google Analytics 4 is installed

Google Analytics 4, which comes with custom event parameters, there is no need to use the predefined parameters like in earlier versions ( Category, Label, Action ).
So we created an option to let the plugin know Google Analytics 4 is installed and like to create events with the new values.

If Google Analytics 4 is installed and Google Analytics 4 option is checked:

  • Event: Click to Chat
  • number: (the number assigned to the icon/button)
  • title: (current page title)
  • URL: (current page url)

If google analytics 4 is installed using a google tag manager, we noticed an issue in creating events. in that case, it better to create events using the data layer from GTM.

If Google Analtyics installed version is not GA4

  • Category: Click to Chat for WhatsApp
  • Action: chat: <number>
  • Label: <post_title>, <URL>

We can view the events at the Google Analytics Dashboard.

To view the real-time events “Real-Time” -> “Event”.

To view the events “BEHAVIOUR” -> “Events” -> “Overview”.

Google Tag Manager

Method 1: Using Class name

We can also use Google Tag Manager to create an event with the custom values.

All styles have a class name: ctc-analytics

based on this class name we can create a click event using Google Tag Manager.

Method 2: DataLayer

Plugin sends an event to GTM using DataLayer

  • event: Click to Chat
  • type: Chat
  • number: (the number assigned to that icon/button)
  • title: (the current page title}
  • URL: (the current page URL)

Using Data layer values we can create an event in google analytics or in other tools that installed using a google tag manager