New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebeedocs
HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Agents
  • Chargebee Copilot
  • Chargebee MCP Server (Model Context Protocol)

Developer Resources


  • Developer Resources Overview
  • Articles and FAQ

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Entitlements


  • Entitlements Overview
  • Features Overview
  • Feature Management
  • Managing Product Entitlements
  • Subscription Entitlements
  • Customer Entitlements
  • Grandfathering Entitlements
  • Articles and FAQ

Usage Based Billing


  • Understanding Usages
  • Setting up Usage Based Billing
  • Usage Alerts
  • Metered Billing
  • Articles and FAQ

Chargebee CPQ


  • Chargebee CPQ
  • Chargebee CPQ for Salesforce
  • Chargebee CPQ for HubSpot

Invoices, Credit Notes, and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Pricing Table
  • Managing Payments with Chargebee.js
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Approvals
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Multi Business Entity


  • Multi Business Entity Overview
  • Customer Transfer Overview
  • Articles and FAQ

Mobile Subscriptions


  • Overview
  • Omnichannel Subscriptions
  • Omnichannel One-Time Orders
  • Mobile Subscriptions (Legacy)

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Ecommerce Management
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Hosted Capabilities
  3. Articles and FAQ
  4. Subscriptions API
  1. Billing
  2. Hosted Capabilities
  3. Articles and FAQ
  4. Subscriptions API

How to setup Google Analytics 4 in Chargebee?

Problem Statement

You want to know how to setup google analytics 4 in chargebee.

Scope

How to configure to new GA4 from UA?

How to set up Google Analytics 4 with Chargebee-hosted pages?

I am an existing user of Google Analytics, how can I migrate to the latest version?

How to migrate from the Universal Analytics version to Google Analytics 4?

What is the difference between UA and GA4?

Summary

Chargebee provides built-in support for Google Analytics 4 (GA4) by sending checkout and portal events to GA. You can tailor your GA4 data collection to meet the specific requirements of your business by utilizing both the built-in Google support and Chargebee's custom GA integration.

From Google Analytics, in the UA property interface, click Admin under the property column, select the property that you'd like to migrate, and click GA4 setup assistant. If you're doing this for the first time, you can either create a new GA4 Analytics property or connect your existing UA property to the GA4 property.

Solution

Add GA4 to a Site with Universal Analytics(UA)

Add GA4 to your existing UA setup to enhance the tracking and analytical capabilities of your website. You should have at least an Edit role for your GA account.

  1. Google setup Assistant Wizard does NOT change or modify your UA account
  2. It also does not backfill your new GA4 property with historical data.
  3. Your GA4 property will only collect data going from the point where you set up the integration

[drive_video embed]

Steps to Migrate

Follow the below steps to add GA4 to a site with UA.

  1. In the UA property interface, click Admin.

  2. Under the property column, select the property that you'd like to migrate and click GA4 setup assistant. If you're doing this for the first time, you can either create a new GA4 Analytics property or connect your existing UA property to the GA4 property.

    image
  3. Click Create property.

Refer to this link on how to add a Google Analytics 4 property (to a site that already has Analytics).

How to get GA4 Measurement ID

You can use the Measurement ID to send data to a specific web data stream.

Follow the steps below to get your GA4 Measurement ID.

  1. Login to your GA4 analytics account.

  2. Navigate to the Admin section.

  3. Under the property section, Click Data streams.

    image
  4. Select the data stream that you wish to track(likely to be your website). Then in the upper right corner, you can see your measurement ID. Refer to this link to know more about G-ID.

    image
  5. Click View tag instructions > Install manually and replace the existing GA script with this one.

    image

If you use Google analytics.js on your site, then e-commerce events will not be sent by the built-in GA integration. You must have gtag.js instead.

Dual Tagging for Google Analytics

If you wish to track both UA and GA4 properties, then update the existing script of your analyitcs to add the new Google tag('G-XXXXXXXXXX') on each page of your website from the JavaScript snippet for your account along with the existing script for your website.

Refer to this link for more information.

Related Articles

Error while using Hosted Pages for Checkout API in case of tier-based pricing
Retrieve Subscription details on custom thank you page.

Was this article helpful?