Using Google Analytics tracking with WidgetMakr

Use Google Analytics to track your WidgetMakr donation form performance.

The latest release of WidgetMakr allows your fundraising organization to tie in your existing Google Analytics/E-Commerce account so that you can track transactions and measure your ROI in Google. WidgetMakr now has an Advanced Options panel in which you can place your tracking script and use our data tokens to send transactional data to Google whenever your get a donation.This is for tracking transactions, not page views. For visitor tracking, you'll need to add your Google Analytics code to the page that you embedded your widget on, or simply use WidgetMakr's built in impressions tracking.Note: If you don't know what I'm talking about, STOP. Mistakes in your JavaScript can result in unexpected behavior. We recommend testing your tracking script on a test widget before making it live. 

1. Understanding Google's Tracking Scripts

Google has two different types of tracking scripts, Asynchronous and Traditional. Use the Asynchronous script. It's newer, it works better, and it's what we tested with. (Compare the two syntax's)Learn more about the Asynchronous Tracking Script Syntax

2. Ready your script for WidgetMakr

You have to configure your script properly for it to push data to your servers.  This is what the basic Script looks like:[learn_more caption="Sample Asynchronous Script"][codebox 1][/learn_more]1. Remove the top and bottom < script> < /script> tags (without the spaces). WidgetMakr adds these tags in for you and will parse them out if you don't remove them.2. Remove the  var _gaq = _gaq || [];It's not necessary because WidgetMakr is already making this call with it's own Google Analytics Script. Leaving this is can cause your JavaScript not to function properly.3. Replace UA-XXXXX-X with your Google Analytics account number.4. Make all the irrelevant fields '0'. There's no tax or tip in online donations.

3. Add your data

WidgetMakr gives you several data points that you can add to your tracking script. These are inserted into your script with tokens that pull the appropriate data at run-time and send it to Google.Note: Remove any quotes around our tokens. For example, you want to have [TransactionId], // order ID - required NOT '[TransactionId]', // order ID - required[learn_more caption="WidgetMakr Tokens"][TransactionId][DonationAmount][SourceCode][TrackingNumber][WidgetId][DonorFirstName][DonorLastName][DonorEmail][DonorCity][DonorState][DonorZip][/learn_more]

4. TEST IT

A good developer knows to always test. I was serious when I said that using this feature can cause unexpected behavior. Make sure you don't accidentally take down your own donation widget because you made a mistake in your JavaScript. Misplaced quotes can mess up your script and ruin your day. Please, test on another widget before making it live on your main donation widget.[learn_more caption="Google E-Commerce Tracking Code - Complete Example"]_gaq.push([‘_setAccount’, ‘UA-XXXXX-X’]);_gaq.push([‘_trackPageview’]);_gaq.push([‘_addTrans’,[TransactionId], // order ID - required‘Your Organizations Name’, // affiliation or store name[DonationAmount], // total - required‘0’, // tax‘0’, // shipping[DonorCity], // city[DonorState], // state or province‘USA’ // country]);// add item might be called for every item in the shopping cart// where your ecommerce engine loops through each item in the cart and// prints out _addItem for each_gaq.push([‘_addItem’,[TransactionId], // order ID - required[SourceCode], // SKU/code - required‘Donation’, // product name[WidgetId], // category or variation[DonationAmount], // unit price - required‘1’ // quantity - required]);_gaq.push([‘_trackTrans’]); //submits transaction to the Analytics servers(function() {var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);})();[/learn_more]One more thing - we only tested this with Google Analytics products, but that doesn't mean it won't work with other JavaScript based tracking codes. It probably will. If you use any other tracking scripts and make it work with WidgetMakr, let us know and we'll post a tutorial!If you have any questions about our new External Conversion Tracking feature, contact us at feedback@widgetmakr.com.

Previous
Previous

Volunteer Fundraising Explodes in 2012

Next
Next

WidgetMakr Now Better Than Ever