All Collections
Advanced Do Goodery
How do I add a tracking code to my campaign?
How do I add a tracking code to my campaign?

Learn how to track where your supporters came from with simple native and UTM tracking codes

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

Do Gooder allows you to track where your supporters originated from using a simple native tracking code which you append to any url as well as standard UTM codes.

Do Gooder native tracking code


The Do Gooder native format is simply:

YOUR-ACCOUNT.good.do/CAMPAIGN-NAME/ACTION-NAME/?dg_track=TRACKING-CODE

The first part of this url is your usual Do Gooder micro-site url with the addition of...

?dg_track=TRACKING-CODE

This addition passes the 'TRACKING-CODE' to Do Gooder and we record this against the supporter if they take action. Be sure to include the ACTION-NAME and not just the CAMPAIGN-NAME in the url for the tracking to be passed through.

You can use this to track the source of a supporter or embed some other unique or static value.

If you prefer to embed your Do Gooder actions then simply add the tracking code to the URL of the action:

YOUR-DOMAIN.COM/ACTION-PAGE/?dg_track=TRACKING-CODE

UTM Codes


UTM Codes are industry standard and look like this:

YOUR-ACCOUNT.good.do/CAMPAIGN-NAME/ACTION-NAME/?utm_id=campaign-1&utm_source=special-promo-campaign&UTM_media=email etc.

The first part of this url is your usual Do Gooder micro-site url with the addition of the various UTM codes to identify the source of the link. These are then passed to the logs for this action event and exported in your CSV or API response. Be sure to include the ACTION-NAME and not just the CAMPAIGN-NAME in the url for the tracking to be passed through.

If you prefer to embed your Do Gooder actions then 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,
});
}
}
});
<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?