Google Analytics/AdWords e-commerce and TeamRaiser

Options

We are testing the waters with Google AdWords, and would like to be able to use Google Analytics' ability to track the amount of a transaction in its goals tracking. However, I'm at a little bit of a loss of how to do get TeamRaiser to talk to GA. I can make a GA goal for TR without any problem. The issue we're running into is how to get the actual transaction value reported back to GA. Any pointers? Thanks!

 

 

Mike

 

Tagged:

Comments

  • Hey Mike,

     

    Have you tried using a Google Analytics track transaction object?  You would need to append your GA code to push the totals to the servers, but it could help in reporting.  I would try using the _addTrans and the _trackTrans values.

     


    _gaq.push(['_setAccount','UA-XXXXX-X']);
    _gaq
    .push(['_trackPageview']);
    _gaq
    .push(['_addTrans',
    '1234', // transaction ID - required
    'Womens Apparel',// affiliation or store name
    '28.28', // total - required
    '1.29', // tax
    '15.00', // shipping
    'San Jose', // city
    'California', // state or province
    'USA' // country
    ]);
    _gaq
    .push(['_addItem',
    '1234', // transaction ID - necessary to associate item with transaction
    'DD44', // SKU/code - required
    'T-Shirt', // product name
    'Olive Medium', // category or variation
    '11.99', // unit price - required
    '1' // quantity - required
    ]);
    _gaq
    .push(['_trackTrans']);

     

     

    Instructions: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce

     

     

     

  • Ryan O'Keefe:

    Hey Mike,

     

    Have you tried using a Google Analytics track transaction object?  You would need to append your GA code to push the totals to the servers, but it could help in reporting.  I would try using the _addTrans and the _trackTrans values.

     


    _gaq.push(['_setAccount','UA-XXXXX-X']);
    _gaq
    .push(['_trackPageview']);
    _gaq
    .push(['_addTrans',
    '1234', // transaction ID - required
    'Womens Apparel',// affiliation or store name
    '28.28', // total - required
    '1.29', // tax
    '15.00', // shipping
    'San Jose', // city
    'California', // state or province
    'USA' // country
    ]);
    _gaq
    .push(['_addItem',
    '1234', // transaction ID - necessary to associate item with transaction
    'DD44', // SKU/code - required
    'T-Shirt', // product name
    'Olive Medium', // category or variation
    '11.99', // unit price - required
    '1' // quantity - required
    ]);
    _gaq
    .push(['_trackTrans']);

     

     

    Instructions: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce

     

     

     

    I get this... I guess my issue is how to get these values from TeamRaiser into GA. I suppose I could use jQuery to add an onclick event to the final submit button, and use values from the appropriate S-tags. But then including upsells and donations to the mix makes things complicated.....

     

     

  • Mike Infranco:

    I get this... I guess my issue is how to get these values from TeamRaiser into GA. I suppose I could use jQuery to add an onclick event to the final submit button, and use values from the appropriate S-tags. But then including upsells and donations to the mix makes things complicated.....

     

     

    Hi Mike,

     

    We got this working in TeamRaiser using the following code snippet.

     


    [[?xcompletedx::x[[E334:[[S334:df_id]].donation]]x::<!-- apply GA e-Commerce tracking -->
    <script type="text/javascript">

    var giftAmount = "[[S120:dc:giftAmount]]";
    giftAmount = giftAmount.replace('$', '');

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxx-x']);
    _gaq.push(["_setDomainName", "none"]);
    _gaq.push(["_setAllowLinker", true]);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_addTrans',
    '[[S120:dc:transactionID]]', // order ID - required - dc:transactionID
    'Convio Donation', // affiliation or store name - Identify Convio Donation
    giftAmount, // total - required, must strip out "$" or else GA will choke - giftAmount var
    '0', // tax - N/A
    '0', // shipping - N/A
    '[[S120:dc:donorCity]]', // city - dc:donorCity
    '[[S120:dc:donorState]]', // state or province - dc:donorState
    '[[S120:dc:donorCountry]]' // country - donorCountry
    ]);

    // add item must be called for every item in the shopping cart
    // prints out _addItem for each
    _gaq.push(['_addItem',
    '[[S120:dc:transactionID]]', // order ID - required - dc:transactionID
    '[[S120:dc:donFormId]]', // SKU/code - required - donFormId
    '[[S120:dc:donationFormName]]', // product name - donationFormName
    '[[S120:dc:campaignId]]', // category or variation - campaignId
    giftAmount, // unit price - required - giftAmount var
    '1' // quantity - required - N/A
    ]);
    _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);
    })();

    </script>
    ::

    <!-- Set regular GA tracking -->
    <script type="text/javascript">
    var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-xxxxxx-x"]);_gaq.push(["_setDomainName", "none"]);_gaq.push(["_setAllowLinker", true]);_gaq.push(["_trackPageview"]);(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);})();
    </script>

    ]]

     

    What it's saying is: if on a donation completed page in TR display the full ecommerce GA code, otherwise just display the standard GA code.

     

    Note you'll need to update the snippet above to include your own UA code, and ecommerce tracking has to be enabled in Google Analytics itself for this to work.

     

    Throw this in the meta section of your page wrapper and you should be all set.

Categories