function donationTracker() { //fetches the donation gift amount var giftAmount = "Gift Amount"; //gets rid of dollar sign giftAmount = giftAmount.replace("$", ""); // gets rid of comma when amount greater than 999 giftAmount = giftAmount.replace(",", ""); //gets campaign name for reporting var campaignId = "dc:campaignId"; //gets campaign id and donation form name for reporting //gets rid of any apostrophe's campaignId = campaignId.replace("'", ""); var donationFormName = "dc:donationFormName"; donationFormName = donationFormName.replace("'", ""); //push data to the datalayer var rev = "Gift Amount"; var recu = "Payment Status"; var mon = "Donation_OneTime"; if (recu == "Active") { mon = "Donation_Recurring"; } dataLayer.push({ 'event': 'sendTransaction', 'ecommerce': { 'purchase': { 'actionField': { 'id': 'dc:transactionID', 'affiliation': 'dc:campaignId', 'sustainerActive': mon, 'revenue': giftAmount }, 'products': [{ 'id': 'dc:donFormId', 'name': donationFormName, 'price': giftAmount, 'category': mon, 'brand': 'DailyBread', 'quantity': 1 }] } } }); } function eCommerceTracker() { //gets the store id var storeId = ""; rowCount = document.querySelectorAll("[class^=ShoppingCartRow]").length; eQuantity = []; transTotal = []; itemName = []; document.querySelectorAll("[class^=ShoppingCartRow]").forEach(function(query) { eQuantity.push(query.querySelectorAll(".quantity-column p")[0].innerHTML.trim()); itemName.push(query.querySelectorAll("span.CartItemName")[0].innerHTML.trim()); transTotal.push(query.querySelectorAll(".price-column p")[0].innerHTML.replace("$", "").trim()); }); trackingCode = document.querySelectorAll('span#tracking_code')[0].innerHTML; eTotal = document.querySelectorAll('#total')[0].innerHTML.replace("$", "").trim(); var personalGift = document.querySelectorAll("#additional_donation")[0].innerHTML.replace("$", "").trim(); if (personalGift > 0) { dataLayer.push({ 'event': 'sendUpsell', 'ecommerce': { 'purchase': { 'actionField': { 'id': trackingCode, //unique transaction ID 'affiliation': storeId, 'revenue': personalGift }, 'products': [{ 'id': trackingCode, 'name': 'Personal Gift', 'category': 'Upsell', 'price': personalGift, 'brand': 'DailyBread', 'quantity': '1' }] } } }); } for (var i = 0; i < rowCount; i++) { if (eQuantity[i] > 0) { dataLayer.push({ 'event': 'sendTransaction', 'ecommerce': { 'purchase': { 'actionField': { 'id': trackingCode, //unique transaction ID 'affiliation': storeId, 'revenue': eTotal }, 'products': [{ 'id': trackingCode, 'name': itemName[i], 'category': 'eCommerce', 'price': transTotal[i], 'brand': 'DailyBread', 'quantity': eQuantity[i] }] } } }); } } }
>
Corus Feeds Kids
The event you requested is not currently published.