It is up to you where you place the code. However, the best place is probably your home page. To add the code to your home page go to "Stores" --> "Template Editor" --> then click on one of the areas that can be edited and select "Edit Content". Click the button near the top right (the "Source Edit" button) in order to switch to HTML mode, and enter in your code there.