Ad code implementation

AdSense code for dynamically generated pages

Our AdSense crawlers index each individual URL containing the AdSense ad code in order to deliver relevant ads to that page. If your site is dynamically generated using a program language such as PHP or is created using information from a database, we'll still be able to target each unique URL with ads specific to the content of that page.

However, the following types of dynamic sites may need modification to receive targeted ads:

  • Dynamic pages that use the POST method for form submission
    Sites using the POST method use the same URL for many different content pages. To allow us to target the content of each unique page, we recommend that you change these pages so that your variables are passed through the URL using the GET method.

  • Sites that are behind a login and personalized to a specific user
    If your site is behind a login, you'll need to allow our crawler to access the content on these pages by explicitly granting it access.

  • Dynamic pages with session IDs
    Sites that append a session ID to a user's URL may encounter problems displaying relevant ads. Session IDs can increase the load placed by our crawlers on one's server due to the manner in which our system indexes pages. We recommend removing session IDs from your URL to help resolve this issue.
  • If you continue to see no ads on your dynamically generated pages, they may be appearing as the result of another issue.

Was this article helpful?
How can we improve it?