Zferral Integration

Chargify integrates with zferral for affiliate and referral program management. You can plug your zferral API credentials in to Chargify, and Chargify will then report revenue for signups, renewals, and (optionally) one-time charges back to zferral so that affiliates can be rewarded for referring people to your services.

What you’ll need:

  1. A zferral account
  2. At least one campaign in zferral. The campaign should be configured to provide “SaaS” or “recurring” payouts.
  3. Your zferral subdomain and API key. You choose the subdomain when you sign up, and your API key is available from the “API” section under “My Profile”

Configuration

Configure your zferral settings for Chargify from the “Integrations” tab. Enter your subdomain and API key and save the settings. If your credentials are correct, you will then see a list of your campaigns. Select all of the zferral campaigns that you wish for Chargify to report into.

As long as you have at least 1 zferral campaign selected, Chargify will report the Subscription signup events and the renewal events and their associated revenue to zferral.

You may choose to also have Chargify report revenue from one-time charges to zferral by selecting this option within the configuration settings.

Reporting Signups

Chargify’s hosted receipt

Chargify will report your signups to zferral automatically, if you use our Hosted Signup page with the default receipt. We do this using the zferral “IMG pixel” tracking, and include a pixel for each campaign that is currently turned on in your Chargify zferral integration settings. Here is an example of the code we include in the hosted receipt page:


<img src="http://<subdomain>.zferral.com/e/<campaign_id>?rev=<signup_revenue>&customerId=<subscription_id>&uniqueId=<signup_payment_id>" style="border: none; display: none" alt=""/>

For zferral’s customerId, which is a unique value to identify the customer who’s account should be linked to the affiliate, we use the ID of the subscription. This is convenient because, in theory, the customer might already exist in Chargify, and hence the affiliate should not get credit for their existing subscriptions – only those that came as a result of the affiliate’s referral.

For zferral’s uniqueId, we use the payment (or payment authorization) transaction ID, since each unique transaction can only capture revenue once.

Your custom receipt page (return URL) from a Hosted page signup

If you use Chargify’s hosted signup pages but a custom receipt page (via the Return URL option), then you will need to embed the zferral tracking pixel yourself.

Chargify exposes the following return parameters that you can use to pass as a query string to your return page, which can in turn generate the correct tracking pixel:

  • subscription_id: The ID for the subscription that was created
  • signup_revenue: The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00)
  • signup_payment_id: The ID of the transaction that generated the revenue

These value may be mapped to the zferral parameters as follows:

  • rev: signup_revenue
  • customerId: subscription_id
  • uniqueId: signup_payment_id

It is your responsibility to post to the correct zferral campaign IDs if you use custom receipts.

You can also use the Chargify API to capture the parameters you need in order to register the signup with zferral. See the next section on API integration.

Your own receipt page after API signup

If you integrate with Chargify via the API for Subscription signups, then you will need to embed the zferral tracking pixel yourself. You can use the following fields on the Subscription resource in order to fulfill the data that zferral requires:

  • id: The ID for the subscription that was created
  • signup_revenue: The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00)
  • signup_payment_id: The ID of the transaction that generated the revenue

These value may be mapped to the zferral parameters as follows:

  • rev: signup_revenue
  • customerId: id
  • uniqueId: signup_payment_id

It is your responsibility to post to the correct zferral campaign IDs if you use your own receipt page.

Reporting Renewal revenue

Every subscription created within Chargify will store a record of the zferral campaigns that were enabled at the time the subscription was created (the “signup campaigns”). When your site receives revenue from a Subscription renewal, Charigfy will send a report of the revenue to zferral. Chargify will report back to all of the signup campaigns that are still active within the configuration settings. So, if you wish to discontinue the sending of data from Chargify to zferral for renewals, you will need to deselect the campaigns from your Chargify zferral integration settings.

All zferral revenue posts will be posted to your Event stream which is available on your Site dashboard. The event will list the amount of revenue posted and whether or not the post was successful.

Chargify does not try to re-post revenue reports to zferral in the case of an error. For example, if you delete the campaign from within zferral, hence causing the revenue post to receive an API error, we will not re-send that revenue report.

Reporting One-time Charge revenue

If you elect to have one-time charge revenue reported to zferral, Chargify will make revenue posts in the same manner as it reports renewal revenue, as described above. This option may be turned on or off at any time.