you only need to put it in your code once, just before display() call. you can include it from another file if you want. you can also use a plugin from the plugins dir, see the documentation how to set one up.