Skip to main content
All CollectionsAnalytics and Reporting
Tracking events and conversions through Google Analytics
Tracking events and conversions through Google Analytics

Using the Google Analytics goals feature to track campaign completions

Corey avatar
Written by Corey
Updated over 2 years ago

A useful way to track events and conversions through Google Analytics is using their Goals feature. There are three key steps in the process, which are explained below in detail:

1. Add an event tracking code snippet to your landing page

Add the following code to the template of the landing page of your CampaignNow action (make sure to update the "YOUR CAMPAIGN NAME HERE" text):

{% if request.url contains "?thanks" %}
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_trackEvent','Direct Email Petition','Submitted','YOUR CAMPAIGN NAME HERE']);
</script>
{% endif %}

2. Update your campaign's redirect URL 

Ensure the redirect URL for your CampaignNow action includes the "?thanks" URL parameter at the end (e.g. http://www.example.org.au/donate_now?thanks). You could substitute the word "thanks" for something more appropriate, as long as you also update the first line of code from point 1 above to reflect that amended URL parameter text.

3. Configure your Google Analytics goal

Go to the relevant view within your Google Analytics property and create a new goal. Select that you wish to create a custom goal of type "event". In the "goal details" section set the Category to "Direct Email Petition", set the Action to "Submitted" and set the label to whatever name you used in step 1 above to replace the text "YOUR CAMPAIGN NAME HERE". Once that's done, you will start to see the conversion data appear in Google Analytics within a couple of hours of the first conversion being achieved.

Google Analytics vs Universal Analytics

One point to note is that NationBuilder loads the ga.js library rather than analytics.js as part of the code provided through their {{content_for_header}} and {{content_for_footer}} snippets.

Did this answer your question?