You should have already followed the recipe entitled Inserting link statistics tracking code in page body using plugin filters in Chapter 2, Plugin Framework Basics, to have a starting point for this recipe. Alternatively, you can get the resulting code (Chapter 2/ch2-page-header-output/ch2-page-header-output-v2.php) from the code bundle downloaded from the Packt website (https://www.packtpub.com/support) and rename the file ch2-page-header-output.php.