The Google Tracking Systems plugin for Joomla 3.x, which allows
you to install Google Analytics code - or Google Tag Manager code -
on every page of our website.
Say goodbye to template editing to put javascript on document.
This plugin does the job for you.
Read more https://extensions.joomla.org/browse/new/extension/site-management/analytics/google-tracking-systems