All Collections
Using Do Gooder
How do I track visitors for reporting and social campaign management?
How do I track visitors for reporting and social campaign management?

Setting up Google Analytics IDs and Facebook tracking codes

David Gravina avatar
Written by David Gravina
Updated over a week ago

We provide real-time stats on campaign performance via our built-in real-time dashboard however if you wish to track campaign success and conversion stats for your email and social campaigns, or run reports over time on your campaign then you'll need to add extra tracking codes from those platforms.

You can do this using a range of methods including:

Google Analytics IDs 

Add one or more Google property ID tags into the Google Analytics field found in the Advanced Tab of the Campaign you wish to track.

We support GA4 and you should insert the full tracking ID including the G- prefix.

Tracking form submissions

We use Google Analytics events for triggering a ‘completed' event. See Google docs. Note that if you redirect our actions to your own pages this event will not fire.

eventCategory
= actions
eventAction = completed
eventLabel = action URL


Tracking page views

Any time an action or a page is viewed we trigger a ‘pageview’ hit. See Google docs.

pageview
– we send a ‘pageview’ hit  for all page views on active campaigns with Google Analytics IDs configured. This includes action views, thank you pages and a campaign's content pages.

If you are embedding your actions you will need to configure the analytics yourself on the parent page, and add code to listen for messages passed from the Do Gooder iframe, for example:

// Google Analytics example assuming gtag has been initialised window.addEventListener("message", function (e) { 
if (e.data && e.data.source === "do_gooder") {
if (e.data.event === "page_view") {
gtag("event", "page_view", {
page_title: e.data.title,
page_location: e.data.url,
});
} else if (e.data.event === "action_complete") {
gtag("event", "form_submit", {
form_id: e.data.url,
});
}
}
});


Facebook

Add your Facebook Pixel ID tracking code to the Facebook field in the Advanced Tab of the campaign you wish to track.

We track both PageView and CompleteRegistration events (for action completion).

If you are embedding your actions you will need to configure the analytics yourself on the parent page, and add code to listen for messages passed from the Do Gooder iframe, for example:

<script> 
// Facebook/Meta pixel example assuming fbq has been initialised window.addEventListener("message", function (e) {
if (e.data && e.data.source === "do_gooder") {
if (e.data.event === "page_view") {
fbq('track', 'PageView') // if you aren't already tracking page views?
} else if (e.data.event === "action_complete") {
fbq("track", "CompleteRegistration", {
content_name: e.data.parameters.url,
});
}
}
});
</script>

Did this answer your question?