Module Configuration
This documentation will show you how to successfully configure Google Tag Manager for WHMCS module.
After install and activate the module, go to Addons -> Google Tag Manager
. At module home you will se the two configurations that you need to provide. Please follow the steps below to properly configure the WHMCS plugin.
Google Tag Manager
After module activation, you need configure the Google Tag Manager container ID. Your GTM container ID can be retrieved from your Google Tag Manager account. If you do not have a GTM account or a container ID you need create it first. Please refer to this link to see how to create your container.
Insert your container ID (ex.: GTM-XXXXX) and save.
After configure your container ID, the Google Tag Manager snippet code will be inserted automatically in all your WHMCS pages. from now it is possible use all resources of your GTM in WHMCS.
To properly track enhanced ecommerce data you need to configure your Google Analytics Measurement ID and Secret API. Please continue to the next step.
Google Analytics
Google Tag Manager for WHMCS module need to know some information about your Google Analytics to enable some offline events capabilities.
Setting the Measurement ID will permit the module to send offline e-commerce events directly from WHMCS back-end making possible track virtually any order made without bind this to the obligation to fire the javascript code from the client-side.
Measurement ID
A measurement ID in Google Analytics is a unique identifier for a web data stream (which is a website registered within Google Analytics). The format of a measurement ID in Google Analytics 4 is 'G-' followed by a combination of numbers and letters, such as 'G-PSW1MY7HB4.'
The measurement ID acts as a critical link, connecting your website to the corresponding data stream in Google Analytics 4. It ensures that the data from your site is sent to the right location.
On September 2023, Google rebranded the global site tag (gtag.js) to Google Tag. Existing GA4 properties can have the new Google Tag as the same Measurement ID, but in some cases they can be different. Ensure that you are using the Measurement ID provided on your selected data stream.
In the Google Tag perspective, the Measurement ID is the same as the Destination ID.
To find the measurement ID, follow these steps:
- In Admin, under Data collection and modification, click Data streams.
- Click the stream for which you want to find the measurement ID.
- The measurement ID is displayed at the top of the page.
If you have difficulty finding the Measurement ID, see the official Google Analytics 4 documentation [GA4] Set up Analytics for a website and/or app.
Please use the same Measurement ID as on your container tags. Using the same Measurement ID ensures consistence on the tracking funnel and conversions.
API secret
The Google Analytics 4 The Measurement Protocol is a set of rules for collecting and sending events directly to Google Analytics servers. Google Tag Manager for WHMCS module lets you send data to Analytics from your WHMCS without user interaction from the front end throw the Measurement Protocol.
A Measurement Protocol API secret is needed to enable this feature.
To create a new secret, navigate to:
- Admin
- Data Streams
- Choose your stream
- Measurement Protocol API secrets
- Create
If you already have an API secret, create a new one only for WHMCS. For better identification define a nickname like "WHMCS".
Paste your new API Secret in Google Analytics tab configuration.
Save the settings clicking on the Save
button.
From now, you have set up all configuration needed to ensure that WHMCS has your tracking info in all pages. The next step is to configure your container with some important information that will bind all the data needed in Enhanced eCommerce from your WHMCS.
Enhanced User Conversion
Available on v4.2
The Enhanced User Conversion feature let you enable user enhanced data layer such as Enhanced Conversions for Web used by Google Ads and User-ID for Google Analytics user-id attributtion.
Enhanced Conversions for Web
Enhanced conversions for web is a feature that can improve the accuracy of your conversion measurement. It supplements your existing conversion tags by sending hashed first-party conversion data from your website to Google in a privacy safe way. The feature uses a secure one-way hashing algorithm called SHA256 on your first party customer data, such as email addresses, before sending to Google.
Enhanced conversions for web improves measurement of online conversions, allowing you to send hashed first-party, user-provided data from your WHMCS when a user converts. The data is then used to match your customers to Google accounts, which were signed-in to when they engaged with one of your ads.
How it Works
When a customer completes a purchase on your WHMCS, you will receive first-party customer data such as an email address, name, address, and/or phone number. This data will be exposed in your data layer, hashed, sent to Google in its hashed form, and then used to enhance your conversion measurement.
- Google signed-in user views your Google ad.
- The user converts on WHMCS.
- WHMCS GTM data layer captures first-party customer data, hashes and sends it to Google.
- The hashed data is matched against Google hashed user data and a conversion is reported in your account.
Enable Enhanced Conversions
To enable Enhanced Conversions for Web, navigate to module menu Enhanced User Conversion
and check the box Enable Enhanced Conversions
.
To learn more about Enhanced Conversions for Web visit About enhanced conversions and Enhanced conversions for web impact results documentation.
User-ID Attribution
User-ID Attribution is a feature that lets you associate a persistent ID for a single user with that user's engagement data from one or more sessions initiated from different devices. By doing so, you can get a more accurate user count, analyze the signed-in user experience, and get insights into your users' behavior across devices.
To enable User-ID collection for GA 4, check the box Enable User-ID Attribution
to set a user id attribute in your data layer.
Define Custom User-ID
To better fit on your user identification strategy, you can choose to between Customer UUID or Customer ID to be used as User-ID Attribution value.
- Customer UUID: Use the WHMCS customer UUID as value, ex.:
c0a8a7b1-1b1b-4b1b-8b1b-1b1b1b1b1b1b
. - Customer ID: Use the WHMCS customer ID as value, ex.:
1234
.
Select the option that best fits your strategy and save the settings.
We do not recommend using the Customer ID as a custom User-ID value as this option will expose the incremental customer ID to datalayer in WHMCS pages when user logged in.
To learn more about User-ID attribution visit Measure activity across platforms with User-ID and The Google Analytics user ID documentation.