This will show you how to add code to your Joomla site footer. Often websites such as Google Analytics will ask you to place code at the very bottom of the your site. They do this so that if their code doesn't load, your site still will. If the code was at the top of the site and had a problem, your whole site would go down.
Login to Your Joomla Site

Go to example.com/administrator and login to your site.
Go to the Template Manager

Click on "Extensions" and then "Template Manager"
Open Your Default Template

rhuk_milkyway is my default template so I'll click on that name.
Open the Template Files

Click "Edit HTML" in the top-right corner.
Enter Your Code

Scroll all the way to the bottom of the page and post your code right above the final lines: . Then click "Save" in the top-right corner and you'll have finished.