The link above explains. But… simply:
1. Go to Appearance > GeneratePress and ensure the Elements module is active.
2. Appearance > Elements > New Element > Hook.
3. Give the hook a title, add the code you have to the Content.
4. Select Hook: before_content
5. Check Execute PHP
6. Display Rules > Set Display Rule > Entire Site
You can change the position it displays by changing the Hook (point 4) to any of those listed in the visual guide above.