Difference between revisions of "Google Analytics"

From WHMCS Documentation

(About this Addon Module)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
== About this Addon Module ==
 +
 +
<div class="docs-alert-success">
 +
* The module supports Google Analytics, Universal Analytics, and Google Analytics 4.
 +
* Google will discontinue support for Universal Analytics on July 1, 2023. [https://help.whmcs.com/m/order_forms/l/1548670-migrating-from-universal-analytics-to-google-analytics-4 We recommend that you use Google Analytics 4.]
 +
</div>
 +
 
Google Analytics allows you to track how people find your site, how they navigate through it and how they become customers. You can see trends of pageviews, visits, bounce rate, conversion rate, geographical locations and much more.
 
Google Analytics allows you to track how people find your site, how they navigate through it and how they become customers. You can see trends of pageviews, visits, bounce rate, conversion rate, geographical locations and much more.
  
And in WHMCS, we've made it easy to install & use by creating an addon module that fully automates the integration process.
+
And in WHMCS, we've made it easy to install and use by creating an addon module that fully automates the integration process.
 +
 
 +
<table class="table" style="text-align:center;margin:1em 1em 1em 0;background:#F9F9F9;border:1px #AAA solid;border-collapse:collapse;width:100%;">
 +
<tr>
 +
<th style="border:1px #AAA solid;padding:0.2em;background:#F2F2F2;text-align:center;">Addon Name</th>
 +
<th style="border:1px #AAA solid;padding:0.2em;background:#F2F2F2;text-align:center;">Latest Release</th>
 +
<th style="border:1px #AAA solid;padding:0.2em;background:#F2F2F2;text-align:center;">Current Version</th>
 +
<th style="border:1px #AAA solid;padding:0.2em;background:#F2F2F2;text-align:center;">Compatible With</th>
 +
<th style="border:1px #AAA solid;padding:0.2em;background:#F2F2F2;text-align:center;">Included in WHMCS</th>
 +
</tr>
 +
<tr>
 +
<td style="border:1px #AAA solid;padding:0.2em;">Google Analytics</td>
 +
<td style="border:1px #AAA solid;padding:0.2em;">N/A</td>
 +
<td style="border:1px #AAA solid;padding:0.2em;">N/A</td>
 +
<td style="border:1px #AAA solid;padding:0.2em;">WHMCS</td>
 +
<td style="border:1px #AAA solid;padding:0.2em;color:darkgreen;">Yes</td>
 +
</tr>
 +
</table>
 +
 
 +
== Activating Google Analytics ==
 +
 
 +
First, you must activate ecommerce reporting for your website's profile in Google Analytics. Because this addon ships with WHMCS by default, you can then immediately activate it in the Admin Area.
 +
 +
To do this:
 +
 
 +
# Sign in to your Google Analytics account.
 +
# Perform the necessary steps to enable ecommerce for your website. [[File:ganalytics1.png|thumb|Enable the Ecommerce Setting]]
 +
# In WHMCS, go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Addon Modules]]''' or, prior to WHMCS 8.0, '''Setup > Addon Modules'''.
 +
# Click '''Activate''' for '''Google Analytics'''.
 +
# Click '''Configure'''.
 +
# Choose your Google Analytics version.
 +
# Enter your '''Measurement ID''' (for Google Analytics 4) or '''Tracking ID''' (for other versions). You can find this in your [http://analytics.google.com Google Analytics account].
 +
# Optionally, enter your '''Tracking Domain'''. We recommend entering this if you use multiple subdomains for your website.
 +
# Select the admin role groups who will have access to this addon.
 +
# Click '''Save Changes'''. 
 +
# If you are using a custom template set, ensure that your <tt>footer.tpl</tt> file contains the <tt>{$footeroutput}</tt> template tag just before the closing <tt></body></tt> tag. This ensures that the tracking code is returned.
 +
 
 +
== Goal Tracking ==
 +
 
 +
Once integrated, you can also take advantage of goal tracking. Goal tracking allows you to set specific pages that indicate that a user has reached the ultimate intended destination. For most people, this is completing an order by placing it and paying.
  
==Setup==
+
In WHMCS, the goal URL for a completed and paid order is <tt>/whmcspath/cart.php?a=complete</tt>. This is the page a user sees after completing checkout and paying using any of the online real-time gateways.
  
The first step of tracking e-commerce transactions with Google Analytics is to enable e-commerce reporting for your website's profile inside the Google Analytics panel:
+
Unfortunately, if using an offline gateway such as '''Mail in Payment''' or '''Bank Transfer''', with which you aren't paid in real-time, goal tracking will not be able to track the conversions of those users.
  
#Sign in to your account.
+
=== Success Conditions ===
#Click Edit next to the profile that you'd like to enable.
 
#On the Profile Settings page, click Edit next to Main Website Profile Information.
 
#Change the E-Commerce Website radio button from No to Yes.
 
  
Once you've done this, simply activate the Google Analytics module in WHMCS ('''Setup > Addon Modules'''). Click the Configure button and enter your Analytics Tracking ID and optionally Root Domain (if you use multiple subdomains for your site) where requested.
+
The goal tracking code is rendered on the '''Order Complete''' stage of the ordering process. The system will direct clients to the '''Order Complete''' page and render the goal tracking code when all three conditions are met:
  
If you are using a custom template set, you need to ensure that your footer.tpl file contains the {$footeroutput} template tag just before the closing </body> tag in order for the tracking code to be output.
+
* The client successfully completes payment.
 +
* Your gateway has notified WHMCS of the payment.
 +
* The invoice in WHMCS is marked paid.
  
==Goal Tracking==
+
If the conditions are not met, the client will be directed to the unpaid invoice with a notice displaying the <tt>invoicePaymentSuccessAwaitingNotify</tt> language string:
  
Once integrated, you can also take advantage of goal tracking. What goal tracking does is allow you to set specific pages that define a user has reached the ultimate intended destination. For most people this is completing an order - placing & paying.
+
<div class="source-cli">
 +
Thank you for completing the payment process. We are awaiting notification to confirm the payment
 +
you just made. We will send you an email confirmation as soon as this has been received.
 +
</div>
  
In WHMCS the goal url for a completed & paid order is '''/whmcspath/cart.php?a=complete'''  This is the page a user ends up on after completing checkout, and making payment for the order using any of the online real-time gateways.
+
This situation might occur if a payment gateway needs to perform extra checks before approving a payment or is experiencing delays sending payment notifications because of a technical issue.
  
Unfortunately if using an offline gateway such as Mail in Payment or Bank Transfer, where you aren't paid in real-time, then goal tracking will not be able to track the conversions of those users.
+
== Troubleshooting ==
 +
 +
''N/A''
 +
 +
== Change Log ==
 +
 +
''N/A''

Latest revision as of 16:06, 28 June 2022

About this Addon Module

Google Analytics allows you to track how people find your site, how they navigate through it and how they become customers. You can see trends of pageviews, visits, bounce rate, conversion rate, geographical locations and much more.

And in WHMCS, we've made it easy to install and use by creating an addon module that fully automates the integration process.

Addon Name Latest Release Current Version Compatible With Included in WHMCS
Google Analytics N/A N/A WHMCS Yes

Activating Google Analytics

First, you must activate ecommerce reporting for your website's profile in Google Analytics. Because this addon ships with WHMCS by default, you can then immediately activate it in the Admin Area.

To do this:

  1. Sign in to your Google Analytics account.
  2. Perform the necessary steps to enable ecommerce for your website.
    Enable the Ecommerce Setting
  3. In WHMCS, go to Configuration () > System Settings > Addon Modules or, prior to WHMCS 8.0, Setup > Addon Modules.
  4. Click Activate for Google Analytics.
  5. Click Configure.
  6. Choose your Google Analytics version.
  7. Enter your Measurement ID (for Google Analytics 4) or Tracking ID (for other versions). You can find this in your Google Analytics account.
  8. Optionally, enter your Tracking Domain. We recommend entering this if you use multiple subdomains for your website.
  9. Select the admin role groups who will have access to this addon.
  10. Click Save Changes.
  11. If you are using a custom template set, ensure that your footer.tpl file contains the {$footeroutput} template tag just before the closing </body> tag. This ensures that the tracking code is returned.

Goal Tracking

Once integrated, you can also take advantage of goal tracking. Goal tracking allows you to set specific pages that indicate that a user has reached the ultimate intended destination. For most people, this is completing an order by placing it and paying.

In WHMCS, the goal URL for a completed and paid order is /whmcspath/cart.php?a=complete. This is the page a user sees after completing checkout and paying using any of the online real-time gateways.

Unfortunately, if using an offline gateway such as Mail in Payment or Bank Transfer, with which you aren't paid in real-time, goal tracking will not be able to track the conversions of those users.

Success Conditions

The goal tracking code is rendered on the Order Complete stage of the ordering process. The system will direct clients to the Order Complete page and render the goal tracking code when all three conditions are met:

  • The client successfully completes payment.
  • Your gateway has notified WHMCS of the payment.
  • The invoice in WHMCS is marked paid.

If the conditions are not met, the client will be directed to the unpaid invoice with a notice displaying the invoicePaymentSuccessAwaitingNotify language string:

Thank you for completing the payment process. We are awaiting notification to confirm the payment you just made. We will send you an email confirmation as soon as this has been received.

This situation might occur if a payment gateway needs to perform extra checks before approving a payment or is experiencing delays sending payment notifications because of a technical issue.

Troubleshooting

N/A

Change Log

N/A