If you want to do it in the viewer or the shortURL viewer you have to include this code in the viewer.php and shorturl.php template files located in content/themes/<Your Theme>/
I do not understand where to add the code that Google ads gave me.
Everywhere I add the code (on viewer.php and shorturl.php) The advertisement adjacent to the right (Hebrew) side of the page and not in the center of the page And the ads hides the picture (The advertisement is on the Picture).