You are here

README.txt in Google AdSense integration 5.2

Same filename in this branch
  1. 5.2 README.txt
  2. 5.2 contrib/README.txt
  3. 5.2 Attic/README.txt
Same filename and directory in other branches
  1. 5.3 README.txt
  2. 5 README.txt
  3. 6 README.txt
Copyright 2005-2008 http://2bits.com

Description
-----------
This module provides web site admins the factility to display Google AdSense
ads on their web site, thus earning revenue.

Resources
---------
You can read the module author's collection of articles on resources for
using Google Adsense with Drupal. They contain hints and tips on how to use
the module, as well as Adsense in general.

http://baheyeldin.com/click/476/0

Prerequisites
-------------
You must signup for a Google AdSense account. If you do not have an account, please
consider using the author's referral link for signup at the following URL:

http://baheyeldin.com/click/476/0


Installation
------------
To install, copy the adsense directory and all its contents to your modules
directory.


Configuration
-------------
To enable this module, visit Administer -> Site building -> Modules, and
enable adsense, and one of the other modules in the Adsense group.

To configure it, go to Administer -> Site configuration -> AdSense.

Follow the online instructions on that page on how to display ads and the
various ways to do so.


API
---
The adsense module provides developers with an API that can be used to control
the Adsense Client ID used for the particular page view.

You can decide to select a different Adsense Client ID based on the content
type, the user's role, the level of user points, the taxonomy of content
page, connecting to Google's API, or anything else imaginable.

To do so, your module must implement a hook called 'adsense', as follows:

Assuming your module is called: your_module.module, you will have the
following function in it. The function has an $op argument that you
should check:

function your_module_adsense($op) {
  if ($op == 'settings') {
    // Add here form elements for your module's settings
    // These can also contain markup elements for help text
    // These are standard FormAPI elements.
    return $form;
  }

  if ($op == 'client_id') {
    // Here you can use whatever logic you want to select a Google Adsense
    // client ID
    return $client_id;
  }
}

See the adsense_basic.module for an example of how to write your own module.

After you install the module, it should appear on the adsense module settings
page, along with other modules. You should be able to select it, and configure
it.

Bugs/Features/Patches
---------------------
If you want to report bugs, feature requests, or submit a patch, please do
so at the project page on the Drupal web site.
http://drupal.org/project/adsense


Author
------
Khalid Baheyeldin (http://baheyeldin.com/khalid and http://2bits.com)

If you use this module, find it useful, and want to send the author a thank
you note, then use the Feedback/Contact page at the URL above.

The author can also be contacted for paid customizations of this and other
modules.

File

README.txt
View source
  1. Copyright 2005-2008 http://2bits.com
  2. Description
  3. -----------
  4. This module provides web site admins the factility to display Google AdSense
  5. ads on their web site, thus earning revenue.
  6. Resources
  7. ---------
  8. You can read the module author's collection of articles on resources for
  9. using Google Adsense with Drupal. They contain hints and tips on how to use
  10. the module, as well as Adsense in general.
  11. http://baheyeldin.com/click/476/0
  12. Prerequisites
  13. -------------
  14. You must signup for a Google AdSense account. If you do not have an account, please
  15. consider using the author's referral link for signup at the following URL:
  16. http://baheyeldin.com/click/476/0
  17. Installation
  18. ------------
  19. To install, copy the adsense directory and all its contents to your modules
  20. directory.
  21. Configuration
  22. -------------
  23. To enable this module, visit Administer -> Site building -> Modules, and
  24. enable adsense, and one of the other modules in the Adsense group.
  25. To configure it, go to Administer -> Site configuration -> AdSense.
  26. Follow the online instructions on that page on how to display ads and the
  27. various ways to do so.
  28. API
  29. ---
  30. The adsense module provides developers with an API that can be used to control
  31. the Adsense Client ID used for the particular page view.
  32. You can decide to select a different Adsense Client ID based on the content
  33. type, the user's role, the level of user points, the taxonomy of content
  34. page, connecting to Google's API, or anything else imaginable.
  35. To do so, your module must implement a hook called 'adsense', as follows:
  36. Assuming your module is called: your_module.module, you will have the
  37. following function in it. The function has an $op argument that you
  38. should check:
  39. function your_module_adsense($op) {
  40. if ($op == 'settings') {
  41. // Add here form elements for your module's settings
  42. // These can also contain markup elements for help text
  43. // These are standard FormAPI elements.
  44. return $form;
  45. }
  46. if ($op == 'client_id') {
  47. // Here you can use whatever logic you want to select a Google Adsense
  48. // client ID
  49. return $client_id;
  50. }
  51. }
  52. See the adsense_basic.module for an example of how to write your own module.
  53. After you install the module, it should appear on the adsense module settings
  54. page, along with other modules. You should be able to select it, and configure
  55. it.
  56. Bugs/Features/Patches
  57. ---------------------
  58. If you want to report bugs, feature requests, or submit a patch, please do
  59. so at the project page on the Drupal web site.
  60. http://drupal.org/project/adsense
  61. Author
  62. ------
  63. Khalid Baheyeldin (http://baheyeldin.com/khalid and http://2bits.com)
  64. If you use this module, find it useful, and want to send the author a thank
  65. you note, then use the Feedback/Contact page at the URL above.
  66. The author can also be contacted for paid customizations of this and other
  67. modules.