1. Configure site tracking for Google Analytics...
  • a. Login to your NetCommunity website and go to Administration > Sites & settings.
  • b. Select the site to configure and then select the Settings tab.
  • c. Under Site Tracking, select Enable Site Tracking.
  • d. In the Site Tracking area, enter the script provided by Google Analytics when you created your website profile with them. You can get this under Admin > Tracking Info > Tracking Code.
2. Configure E-Commerce (in Google Analytics)...
  • a. Login to Google Analytics and select your website's profile.
  • b. Click on the Admin button at the top, right-hand corner of the page.
  • c. Under the View section, click on View Settings > Ecommerce Settings and turn Ecommerce tracking on.
  • d. Click Save to save your settings.

3. Edit the page that has a donation form on it and add the following code inside an Unformatted Text part. While editing the Unformatted Text part, select Show Advanced Options and choose at the end of the <body> tag from the drop down menu.
<script type="text/javascript">
    BLACKBAUD.netcommunity.api.DonationConfirmation.add(function (data) {
        if (data.TransTotal) {
                                                var items=[];
                                                var dataItem;

                                                for (var i = 0; i < data.Items.length; i++) {
                                                                dataItem.id= data.Items[i].ID;
                                                                dataItem.name = data.Items[i].Name;
                                                                dataItem.list_name = '',
                                                                dataItem.category= data.Items[i].Name;
                                                                dataItem.price= data.Items[i].Price;
                                                                dataItem.quantity= data.Items[i].Quantity;                         

                                                gtag('event', 'purchase', {
                                                                                                                "transaction_id": data.TransID,
                                                                                                                "affiliation": '',
                                                                                                               "value": data.TransTotal,
                                                                                                                "currency": '',
                                                                                                                "tax": '',
                                                                                                                "shipping": '',
                                                                                                                "items": items

This script will track the following data associated with successfully submitted donations:

Data ID in Google Analytics

Description of Data Type


Total dollar amount for the transaction.


Identifies the transaction.


Items included in the transaction. If the transaction contains multiple items (for example, a transaction from a Payment 2.0 part may include several purchased items), the items are identified as data.Item[0], data.Item[1], data.Item[2], etc.


Associates an item with a transaction. This is the same value as the TransID.


Unique SKU used to track the price and quantity of an item.


Human readable name for an item.


Price of an item.


Number of items purchased of the same type.

4. Configure goals in Google Analytics ...
You can use goals in Google Analytics to track conversions on your website. In this example, you'll be creating a goal to track the number of donations made on a particular donation page.
  • a. Login to Google Analytics and select your website's profile.
  • b. Click on the Admin button at the top, right-hand corner of the page.
  • c. Under the View section, click on Goals and then click on CREATE A GOAL.
  • d. Select a template to start with a pre-filled configuration and click the Next step button.
  • e. Enter a Goal description
  • f. For Type, mark the Destination radio button
  • g. Click Continue
  • h. Under the Goal details area, select Regular Expression under Destination.
  • i. Enter "DonationStep_[PART ID]=DonationStep_Acknowledgement" in the field next to it. You will replace [PART ID] with the actual ID of your donation form part, which can be found in the URL bar (address bar) of your web browser when editing the part (see illustration below).
  • j. Select any additional options and then click Save Goal to save your settings.

Additional Notes:

Goals can be setup for other purposes, not just donations. For more information about how URL's are built for different part types, see Site Tracking URL Examples.

You can create as many goals as you like in Google Analytics but you'll need to make sure you add the above piece of JavaScript into an Unformatted Text part on any page that includes one of these part types:
  • Donation Form
  • Membership Form
  • Event Registration Form
  • Payment 2.0.
The script you entered in the Unformatted Text part sends tracking information to Google Analytics about transactions made on those pages.