rewardfulfunction to the page, which can be immediately called and passed instructions that Rewardful will execute once loaded. The general format of these method calls is
rewardful(methodName, arg1, arg2, arg3, ...)
rewardfulfunction. To make it simple, we recommend adding it immediately before the script tag that loads the remote Rewardful script from Step #1 in the setup instructions. Your final Step #1 snippet should look something like this:
"convert"function, and pass the customer's email address using the
convertfunction does nothing.
readyhandler to have it executed when Rewardful has fully loaded. This function always executes, whether the current visitor is a referral or not. For example:
rewardfulare queued and executed in order once Rewardful has loaded. This means you can queue up multiple functions, and even call
rewardfulif Rewardful is loaded (which effectively calls the underlying function immediately). For example:
example.com/?via=bond007you could create a page at
example.com/bondand include the snippet below to ensure all visitors to this page get attributed to James Bond:
example.com/?via=batmanbut then went on to visit
example.com/bond(where the code above is executed) then James Bond would ultimately get credited for the conversion.
?via=tokenquery string parameter when attributing a visit to an affiliate. When the
viaparameter is present and valid, a new referral will be created for the affiliate and the referral ID stored in the cookie as
?referral=<UUID>parameter to the URL:
viaparameter then two referrals will be created (one for each window) which artificially inflates visitor stats.
referral=<UUID>parameter to the iframe URL before inserting the iframe into the DOM:
iframe, ensure you have a fallback plan in case Rewardful never loads. See Executing code when Rewardful loads for more information.
Rewardful.referralwill return the Referral ID of the current visitor if they were referred, for example:
Rewardful.referralwill return an empty string:
Rewardful.affiliatewill return some information about who sent you a referral, for example:
falseif there is no affiliate, i.e. the current visitor was not referred.
Rewardful.campaignwill return the ID and name of the campaign the affiliate is associated with:
data-rewardfulattribute. This makes it simple to get the referral ID sent to your server along with the rest of the data from your signup or payment form.
referralwith the unique click ID (UUID) as the value. For example:
POSTdata sent to your server will include the
referralparameter, along with the rest of the customer data. You can extract this value (
params[:referral]in Rails, etc) and add it to the Stripe customer's metadata or save it in your own database for future use.
data-rewardfulattribute, you can call
Rewardful.Forms.add(formElement), for example:
formtag (for example, using a CMS or hosted service) and are unable to add the