Gift Type data id for GA

Options
Hi there,


Does anyone know what the BBNC Thank You page "Gift Type" data variable is called?  i.e. data.Items[i].GiftType ?  I'm looking to distinguish individual vs. committed gifts in Google Analytics.


Thanks,

John
Tagged:

Comments

  • John Greenshields:

    Hi there,


    Does anyone know what the BBNC Thank You page "Gift Type" data variable is called?  i.e. data.Items[i].GiftType ?  I'm looking to distinguish individual vs. committed gifts in Google Analytics.


    Thanks,

    John

    Is this on the email the donor receives or is it on the screen the donor sees after finishing the transaction?

     

  • Mark Guncheon:

    John Greenshields:

    Hi there,


    Does anyone know what the BBNC Thank You page "Gift Type" data variable is called?  i.e. data.Items[i].GiftType ?  I'm looking to distinguish individual vs. committed gifts in Google Analytics.


    Thanks,

    John

    Is this on the email the donor receives or is it on the screen the donor sees after finishing the transaction?

     

     

    Hi Mark,


    It's the screen the donor sees after finishing the transaction.  I'd like to capture in the Google Analytics ecommerce code whether it's a individual or committed gift.


    Thanks,

    John

  • Hi John,


    When a donor gets to the confirmation page, the information that is populated is based on the type of gift selected on the donation form, such as a one time gift or a recurring gift. The information is displayed via merge fields, which pull and display the information the donor supplied on the form. For recurring gifts, the merge fields are contained within loops or special denoted sections where those fields must be contained. For instance, with recurring gifts there is a recurring gift begin field and a recurring gift end field. All of the other merge fields related to recurring gifts must be contained within this section. Hope this helps!


    Thanks!

    Tony
  • Tony Williams:

    Hi John,


    When a donor gets to the confirmation page, the information that is populated is based on the type of gift selected on the donation form, such as a one time gift or a recurring gift. The information is displayed via merge fields, which pull and display the information the donor supplied on the form. For recurring gifts, the merge fields are contained within loops or special denoted sections where those fields must be contained. For instance, with recurring gifts there is a recurring gift begin field and a recurring gift end field. All of the other merge fields related to recurring gifts must be contained within this section. Hope this helps!


    Thanks!

    Tony

    Thanks Tony, however that is not what I was inquiring about.  In Blackbaud's Google Analytics configuration knowledgebase page (https://kb.blackbaud.com/articles/Article/66890) you'll see in the code variables being drawn upon (i.e. data.Items[i].SKU, data.Items[i].ID, data.Items[i].Name, etc.).  I wanted to know if there was a Gift Type variable to indicate an individual vs. a committed gift.


    Thanks,

    John

  • John Greenshields:

    Hi there,


    Does anyone know what the BBNC Thank You page "Gift Type" data variable is called?  i.e. data.Items[i].GiftType ?  I'm looking to distinguish individual vs. committed gifts in Google Analytics.


    Thanks,

    John

    I have found a workaround using jQuery:
    • I added <span> tag around the Frequency merge field with the id="recurringTrans"
    • In my GA code I then included the following code and then appended the variable donationType
    if ($("#recurringTrans").text().indexOf("of every month") >= 0) {


    donationType = " (Monthly)";

    }




    Here's the full code which appends " (Monthly)" to the end of the GA Product Name if a monthly committed gift:

     
    <script type="text/javascript">


    var donationType = "";


    $(window).load(function () {


        BLACKBAUD.netcommunity.api.DonationConfirmation.add(function (data) {


            if (data.TransTotal) {


    if ($("#recurringTrans").text().indexOf("of every month") >= 0) {


    donationType = " (Monthly)";


    }


     


                ga('ecommerce:addTransaction', {


                    'id': data.TransID,


                    'affiliation': '',


                    'revenue': data.TransTotal,


                    'shipping': '',


                    'tax': ''


                });


                for (var i = 0; i < data.Items.length; i++) {


                    ga('ecommerce:addItem', {


                        'id': data.Items[i].ID,


                        'name': data.Items[i].Name + donationType,


                        'sku': data.Items[i].SKU,


                        'category': data.Items[i].Name,


                        'price': data.Items[i].Price,


                        'quantity': data.Items[i].Quantity


                    });


                }


                ga('ecommerce:send');


                ga('ecommerce:clear');


            }


        });


    });


    </script>


    *Note this code only works for monthly, but can be adapted for other frequencies

Categories