Opt-In Mining System

Website Cryptocurrency Mining

Opt-In Mining System

November 17, 2017 Code News Publishers 0

We had a request for an opt-in only system for website visitors so here’s some code to use if you want to create an opt-in mining platform. This means mining wont start until users click a button.

function jseStartMining() {
  var jseUserID = '185';
  var jseSiteID = 'mysite.com';
  var jseSubID = 'optional';
  var e=document,t=e.createElement("script"),s=e.getElementsByTagName("script")[0];
  document.getElementById('jseButtonText').innerHTML = 'Mining Started';
document.write('<button onclick="jseStartMining();"<span id="jseButtonText">Start Mining</span></button>');

Before using this in production make sure you change the jseUserID (this can be found on the dashboard when you log in to the platform) and also the jseSiteID variable.

The code will place a small button like the one below on the page that users can click to start mining. No JSEcoin code will load in the users browser until that button is pressed.

Generally we don’t believe a opt-in system will work for all the same reasons it doesn’t work for digital advertising. There would never be enough users opt-in to see banner ads for example to effectively monetize a website.

The privacy notice will still have an opt-out feature and this overrides anything else. If a user clicks the opt-out link it will stop mining across the entire network regardless.

This is what the code looks like running in a web developer console: