Add Google Analytics code in your wordpress footer

This snippet is a example on how we can add a Google Analytic code in our theme. In my case I would like to add it on the footer.

You can manually add the Google Analytic in footer but this code we will add it using our functions.php

Then replace the UA-XXXX-X from the code you will get from your Google Analytic.