Difference between revisions of "Google Analytics"

From WHMCS Documentation

(Setup)
Line 8: Line 8:
 
The module supports Google Analytics, Universal Analytics, and Google Analytics 4.
 
The module supports Google Analytics, Universal Analytics, and Google Analytics 4.
 
</div>
 
</div>
 
+
 
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:
 
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:
 
[[File:ganalytics1.png|thumb|Enable the Ecommerce Setting]]
 
[[File:ganalytics1.png|thumb|Enable the Ecommerce Setting]]
 
+
 
To do this:
 
To do this:
 
#Sign in to your account.
 
#Sign in to your account.
Line 18: Line 18:
 
#Toggle '''E-Commerce Website''' from '''No''' to '''Yes'''.
 
#Toggle '''E-Commerce Website''' from '''No''' to '''Yes'''.
 
#Click '''Save'''.
 
#Click '''Save'''.
 
+
<br/>
 
 
 
 
Next, return to the WHMCS admin area:
 
Next, return to the WHMCS admin area:
 
#Navigate to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Addon_Modules_Management|Addon Modules]]''' or, prior to WHMCS 8.0, '''Setup > Addon Modules'''.
 
#Navigate to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Addon_Modules_Management|Addon Modules]]''' or, prior to WHMCS 8.0, '''Setup > Addon Modules'''.
 
#Click '''Activate''' next to the Google Analytics module.
 
#Click '''Activate''' next to the Google Analytics module.
 
#Click '''Configure'''.
 
#Click '''Configure'''.
#Enter your '''Analytics Tracking ID''' and, optionally, '''Root Domain''' (if you use multiple subdomains for your site).
+
#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.
 +
#Choose one or more admin roles that can access the module.
 
#Click '''Save Changes'''.
 
#Click '''Save Changes'''.
 +
 +
If you are using a custom template set, you need to 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.
  
If you are using a custom template set, you need to 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==
 
==Goal Tracking==

Revision as of 17:15, 13 May 2021

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.

Setup

Note
The module supports Google Analytics, Universal Analytics, and Google Analytics 4.

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:

Enable the Ecommerce Setting

To do this:

  1. Sign in to your account.
  2. Click the Admin cog icon in the bottom-right corner.
  3. In the View column, click Ecommerce Settings.
  4. Toggle E-Commerce Website from No to Yes.
  5. Click Save.

Next, return to the WHMCS admin area:

  1. Navigate to Configuration () > System Settings > Addon Modules or, prior to WHMCS 8.0, Setup > Addon Modules.
  2. Click Activate next to the Google Analytics module.
  3. Click Configure.
  4. Choose your Google Analytics version.
  5. Enter your Measurement ID (for Google Analytics 4) or Tracking ID (for other versions). You can find this in your [Analytics account].
  6. Optionally, enter your Tracking Domain. We recommend entering this if you use multiple subdomains for your website.
  7. Choose one or more admin roles that can access the module.
  8. Click Save Changes.

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. 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.