paint-brush
Coil Monetization Shortcuts: The Easy Way To Find Out How Much You Are Makingby@johnonym
132 reads

Coil Monetization Shortcuts: The Easy Way To Find Out How Much You Are Making

by John EdvardNovember 15th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

How much do I get from a micro transaction for a user that visits my monetized page?Prerequisites: The reader needs to have a Coil subscription, and the Coil extension for Chrome. The details of a single transaction look like this:amount (the amount of assets, e.g. 2491) Amount of assets being transferred, and what currency (e.g XRP or USD) is being sent in one single transaction. If a transaction looks like the above example, it means that 2491 nano XRP (or 0.000002491 XRP)

Company Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Coil Monetization Shortcuts: The Easy Way To Find Out How Much You Are Making
John Edvard HackerNoon profile picture

How much do I get from a micro transaction for a user that visits my monetized page?

Prerequisites

The reader needs to have a Coil subscription, and the Coil extension for Chrome

How to sniff the transactions?

Right click anywhere on the page, and click "Inspect", to open the inspector window, and you will see something similar as the below image.

Copy and paste the below snippet in the console tab of your debugger tool to see the monetization in progress.

totalAmount = 0;
document.monetization.addEventListener('monetizationprogress', function(event){
  var amount = parseInt(event.detail.amount);
  amount = amount/(Math.pow(10,event.detail.assetScale));
  totalAmount += amount;
  console.log(totalAmount);
  console.log(event.detail);
});

And that's it. If the requirements are met, you will be able to see the accumulative transactions, as well as the details for a single transaction, like how much assets are being transferred, and what currency (e.g. XRP or USD). The console window will print every singe transaction made. The details of a single transaction look like this:

  • amount (the amount of assets, e.g. 2491)
  • assetScale (the proportion of the asset, e.g 9)
  • assetCode (the currency being transferred, e.g XRP)

If a transaction looks like the above example, it means that 2491 nano XRP (or 0.000002491 XRP) is being sent in one single transaction. You can find more details from Coil's documentation