Different Advertising code for category and page

How is it possible to use different Advertising code for category and page?

At the moment I can set in taxonomy/category at ‘Werbemittel’ something like advertising a JS code. So the advertising will be used on all pages in that category.

But I also like to add a ‘Werbemittel’/advertising an single pages. For that I have added a fileld on the page where I can add the jS code. But that JS code is not shown. How can I tell Drupal that on a page he should use my JS code for the page?

I am using Drupal 7. I find the template file where the code is rendered.
<?php print $content['adtop']; ?>
But where is the $content generated?

I am thinking I need to modify that theme?, right?

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/3/feed