Google Tag Manager data layer
Sponsored Donations
Sponsored donations are ones made from someone’s fundraising page.
// Create Pageview
dataLayer.push({
‘event’: ‘VirtualPageview’,
‘virtualPageURL’: ‘/sponsor/confirmation/{tax_ref}’
});
// E-commerce data
dataLayer = [{
‘ecommerce’: {
‘currencyCode’:platform_currency,
‘purchase’ : {
‘actionField’: {
‘id’: donation_id,
‘revenue’: d_amount,
‘type’: donation_type // ‘online’, ‘recurring’, or ‘personal’
‘payment_method’:payment_method,
‘po_number’: po_number,
‘tax_ref’: tax_ref
},
‘products’: [{
‘name’: ‘member’, ‘team’, or ‘organisation’,
‘id’: online event's event_code or DIY's category_name,
‘price’: d_amount,
‘category’: ‘Personal Donation’ or ‘Sponsored Donation’,
‘quantity’: 1,
}]
}
}
}];
// event
dataLayer.push({
‘event’: ‘donation’
‘eventMeta’: ‘Personal Donation’ or ‘Sponsored Donation’,
‘eventCode’: online event's event_code or DIY's category_name,
});
Non-Sponsored Donations (Generic Donations)
Non-Sponsored donations are donations made to a generic donation / crowdfunding page.
// e-commerce
dataLayer = [{
‘ecommerce’: {
‘currencyCode’: platform_currency,
‘purchase’ : {
‘actionField’: {
‘id’: donation_id,
‘revenue’: d_amount,
‘payment_method’: payment_method,
‘po_number’: po_number,
‘frequency’: ‘Weekly’,‘Monthly’, ‘Yearly’, or ‘one-off’,
‘type’: donation_type // ‘online’, or ‘recurring’
},
‘products’: [{
‘name’: page_name,
‘id’: event_page_id or page_id,
‘price’: ‘d_amount’,
‘category’:‘Donation’,
‘quantity’: 1,
}]
}
}
}];
// event
dataLayer.push({
‘event’: ‘donation-success’,
‘eventMeta’: ‘Donation’
});
Online Event Registrations
On the registration completion lightbox:
// e-commerce data
dataLayer = [{
‘ecommerce’: {
‘currencyCode’:platform_currency,
‘purchase’ : {
‘actionField’: {
‘id’: ‘history_id’,
‘revenue’: ‘total_paid’,
‘po_number’: po_number,
‘payment_method’: payment_method,
‘tax_ref’: ‘tax_ref’,
‘hashed_email’: hash(m_email),
},
‘products’: [{
‘name’: event_name,
‘id’: event_code,
‘price’: total_paid_entry,
‘category’: ‘Registration’,
‘quantity’:`1`,
‘brand’: event_code
}
// optional donation
,{
‘name’: event_name,
‘id’: event_code,
‘price’: m_donation_amount,
‘category’: ‘Personal Donation’,
‘quantity’:`1`,
‘brand’: event_code
}
// optional merchandise
,{
‘name’: event_name,
‘id’: event_code,
‘price’: total_paid_merchandise,
‘category’: ‘Merchandise’,
‘quantity’:`1`,
‘brand’: event_code
}
]}}}];
// Event
dataLayer.push({
‘event’: ‘registration’,
‘eventMeta’: ‘Event Registration’,
‘eventCode’:event_code,
});
// optional donation
dataLayer.push({
‘event’: ‘donation’,
‘eventMeta’: ‘Personal Donation’,
‘eventCode’: event_code,
});