Revenue Tracking in SimpleGive Platform

How Can We Help?

Categories
Table of Contents

Donation amount

function(){

var amount = extractMoney(document.getElementsByClassName('text-left')[0].innerText);          console.log(amount['amount']);
  return amount['amount']; 
}

Trigger

Use Element Visibility and look for class name – .thankyou-icon

Special Note

Must add this to every page where amount is needed

  var extractMoney = function(string) {
    var amount = string.match(/[0-9]+([,.][0-9]+)?/)
    var unit = string.replace(/[0-9]+([,.][0-9]+)?/, "")
    if (amount && unit) {
      return {
        amount: +amount[0].replace(",", "."),
        currency: unit
      }
    }
    return null;
  }
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on email
Email
Share on print
Print