Donorbox initializes a global JavaScript object DONORBOX which will contain the 'donation' object after the successful donation is made. Thus DONORBOX.donation will be available to "After donation tracking code" scripts to leverage the benefit of conversion tracking scripts. Following details of the donation will be available for tracking:
- DONORBOX.donation.id
- DONORBOX.donation.currency
- DONORBOX.donation.amount
- DONORBOX.donation.donation_type
- DONORBOX.donation.payment_method
- DONORBOX.donation.additional_questions
- DONORBOX.donation.org.id
- DONORBOX.donation.org.name
- DONORBOX.donation.form.id (This refers to campaign ID)
- DONORBOX.donation.form.name (This refers to campaign name)
Below example shows how to track a custom gtag event using the above variables:
gtag('event', 'donated_successfully', {
'event_label': DONORBOX.donation.form.name,
'event_category': 'donation',
'value': DONORBOX.donation.amount
});
Comments
0 comments
Article is closed for comments.