You are here: Administration > Settings > Site Settings > Configure E-Commerce

Configure E-Commerce

You can enable E-Commerce in Google Analytics to track and report on revenue transactions made on pages that contain these part types: Donation Form, Membership Form, Event Registration Form, and Payment 2.0. If you have the eStore customization, you can also track transactions on pages with the eStore Storefront part.

1. From the Google Analytics website profiles page, click Edit for the website profile to configure. The Profile Settings page appears.
2. In the Main Website Profile Information section, click Edit. The Edit Profile Information Page appears.
3. Under E-Commerce Website, select Yes, an E-Commerce Site.
4. Click Save Changes.
5. Open Blackbaud NetCommunity. From Parts, create a new Unformatted Text part.

Note: For information about how to create an Unformatted Text part, see Unformatted Text.

6. In the box, enter this script and then click Save.

<script type="text/javascript">

var _gaq = _gaq || [];

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

if(data.TransTotal){

_gaq.push(['_addTrans', data.TransID, '',data.TransTotal, '', '', '', '', '']);

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

_gaq.push(['_addItem', data.Items[i].ID, data.Items[i].SKU, data.Items[i].Name, '', data.Items[i].Price, data.Items[i].Quantity]);

};

_gaq.push(['_trackTrans']);

};

});

</script>

7. Select Show advanced options.
8. In the Placement in text field, select “In the <body> tag with the part”.
9. Place the Unformatted Text part on any page that includes one of these part types: Donation Form, Membership Form, Event Registration Form, and Payment 2.0. The script you entered in the Unformatted Text part sends tracking information to Google Analytics about transactions made on those pages. The tracking information includes:

Data ID in

Google Analytics

Description of data type

data.TransTotal

Total dollar amount for the transaction.

data.TransID

Identifies the transaction.

data.Items

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.

data.Items.ID:

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

data.Items.SKU

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

data.Items.Name

Human readable name for an item.

data.Items.Price

Price of an item.

data.Items.Quantity

Number of items purchased of the same type.