WHMCS has a free add-on that allows you to easily insert Google Analytics tracking code.
But if - for any reason - you need to use original Google Analytics tracking code, you can do it editing your header.tpl file, and inserting (somewhere between <head></head> tags) following code (substitute the fake id UA-12345678-1 with your own!):
<!-- Global site tag (gtag.js) - Google Analytics -->{literal}
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
gtag('config', 'UA-12345678-1');</script>
{/literal}<!-- End Google Analytics -->
NOTE: take care to insert Smarty {literal}{/literal} tags, otherwise your site will probably crash!


