2 Monetarization
izzy edited this page 1 year ago



Starting with v2.5.0 you can easily set up your own donation links. They are defined in CSV format; you can find an example in doc/donationinfo.csv. Copy that file, adjust the links, and enable these donations in your config by pointing the $donationInfo variable to your copy (e.g. $donationInfo = 'doc/donationinfo.csv'). Donation buttons will then show up at the bottom of each book detail page.

Setting up Amazon Ads

To use Amazon Ads for monetarization, you first need to register your AmazonID via the Amazon Partner Net. Once this type of advertizing is then set up, you will be paid by Amazon whenever someone followed one of your Amazon links – for all articles put into the visitors shopping cart within half an hour after clicking the link.

There are two ways to setup Amazon Ads in miniCalOPe, both having their pros and cons:

Type Pros Cons
flash easy to setup compromises your users’ privacy as ads are loaded directly from Amazon in the users’ browsers, and requiring JavaScript + Flash
asap requires another (free) library and more setup efforts; ads are less fancy very privacy friendly as all ads are prepared locally and delivered from your server; so for the user, Amazon only gets involved when a link is clicked

You can chose between the two by setting $ads_bookdetails_type = 'flash'; or $ads_bookdetails_type = 'asap'; – the config.advanced.php has the settings prepared for you to copy from.

In any case, the first thing you need to fill in is your AmazonID in $amazonID=''; – by default, this is empty, and thus no Amazon Ads will be used.

Using Amazon Flash Ads

To use the (less privacy-friendly) Amazon Flash ads, there’s nothing else to do: simply specify your $amazonID, set $ads_bookdetails_type = 'asap'; – and you’re done.

Using the ASAP library

To use this library, you first need to download it and install it into your PHP path. You can find the library here – and before you ask, ASAP stands for „Amazon Simple Api for Php” (for setting it up, please follow the instructions given there). Further, you need to obtain an API key from Amazon Partner Net. In the miniCalOPe configuration, then fill the $ads_asap_pubkey and $ads_asap_privkey with the key data obtained, and set the $ads_asap_country accordingly with the 2-letter country code. You’re done – now you should serve Amazon Ads in a more privacy-friendly way.

You can adjust what ads are selected for each category by editing the lib/asap_genres.json file (see the lib/asap_genres.json.sample shipping with miniCalOPe). For available SearchIndexes (prodgroup:: in asap_genres.json) please consult the corresponding Amazon Partner Net documentation; examples include: Books, DVD, Electronics, MP3Downloads, Music, SportingGoods, Toys, Video, Watches. To not have to define this for each category manually, you can set the defaults in your config, see $ads_asap_default_string and $ads_asap_genre_strings.