integration-google-analytics-logo

Google Analytics 4 Juvo Leads Integration

We have 2 events that we can pass to GA4.

  • chat-started
  • chat-saved

Here’s how each event is triggered:

  • Once a chat has been started, our system will send the chat-started event to your GA4.
  • Once a chat has been saved for a lead, our system will send the chat-saved event to GA4.

Please note GA4 has a delay for reporting, it can take up to 24 hours before you see the event(s) show up in your GA4 reports.  That being said, you can go to Reports > Realtime to see the most recent events that have occurred in the last 30 minutes.  This is a great way to see if events are coming in to GA4 without having to wait the full 24 hours.

To set up GA4 for the chat-saved event and the chat-started navigate to your Site Settings in your Juvo Leads Dashboard and click on Advanced Integrations. Navigate to Google Analytics (GA4) Integration and add your javascript code under the appropriate function. Example code has been provided depending on your implementation of Google Analytics.

Chat Started Hook


console.log("chat-started event sent");

//Option 1: Sends event to Google Analytics using the Global Site Tag (gtag.js)
gtag('event', 'chat-started');

//Option 2: Sends the event to Google Tag Manager (GTM) dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "chat-started"
});

Chat Saved Hook


console.log("chat-saved event sent");

//Option 1: Sends event to Google Analytics using the Global Site Tag (gtag.js)
gtag('event', 'chat-saved');

//Option 2: Sends the event to Google Tag Manager (GTM) dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "chat-saved"
});

Once the events have been setup for your account, you can open up Developer Console to force the event to fire for testing purposes.

  1. Open up Developer Console
  2. Type juvo_chat_started() or juvo_chat_saved() and hit return.
  3. Go into GA4 Reports > Realtime to see if the events show up.

Important: If you are using Option 2 (sending the events into Google Tag Manager dataLayer).  Please make sure to map those events to wherever you need them go to (example: GA4 or Google Adwords).  Documentation below on how to set this up.

Step 1: Create a GA4 Event Tag

  1. Open Google Tag Manager (tagmanager.google.com).
  2. GTM → Tags → Click New.
  3. Choose “Google Analytics: GA4 Event” as the tag type.
  4. Set “Configuration Tag” to your existing GA4 configuration.
  5. Set “Event Name” to: chat-saved
  6. Skip the “Event Parameters” section.
  7. Click Save.

Step 2: Create a Trigger for the Event

  1. Open Google Tag Manager (tagmanager.google.com).
  2. Click on “Triggering” → New.
  3. Choose “Custom Event”.
  4. Set the Event Name to: chat-saved
  5. Click Save.

If you need assistance with GA4 set up, schedule a call.