Link Tracking with Action Network pages
Last updated: April 3, 2026
If you want to be able to track links that redirect to an Action Network page you need to format your links and your landing page on Action Network in a specific way:
On Switchboard:
When drafting a broadcast or email blast, use this syntax below to enable the tracking:
{{ "https://your-action-network-form-url.com" | sb_actblue | sb_link }}
If you omit "sb_link" then it won't convert the URL into a shortlink, in case you want to preserve the longer link in the message. However, if you do that, we will not be able to track clicks, only the donation.
To test and see if it worked properly, click on the shortlink in the rendered message preview -- it should go to your Action Network form, and it should have a query parameter in the URL that looks like refcodeSB=... .
In Action Network:
First you need to add this to custom scripts under sharing and tracking:
<script>
(function() {
// Capture refcodeSB from URL
var urlParams = new URLSearchParams(window.location.search);
var refcodeSB = urlParams.get('refcodeSB');
if (refcodeSB) {
// Store it for the redirect
sessionStorage.setItem('refcodeSB', refcodeSB);
// Add to form as hidden field (for Action Network's thank-you page)
var form = document.querySelector('form.action_form');
if (form && !form.querySelector('input[name="refcodeSB"]')) {
var hiddenInput = document.createElement('input');
hiddenInput.type = 'hidden';
hiddenInput.name = 'refcodeSB';
hiddenInput.value = refcodeSB;
form.appendChild(hiddenInput);
}
}
// When form submits successfully, redirect to ActBlue with refcodeSB
if (window.location.pathname.includes('thanks')) {
var stored = sessionStorage.getItem('refcodeSB');
if (stored) {
// Get the ActBlue link and append refcodeSB
var actblueLink =
document.querySelector('a[href*="secure.actblue.com"]');
if (actblueLink) {
var url = new URL(actblueLink.href);
url.searchParams.set('refcodeSB', stored);
actblueLink.href = url.toString();
// Auto-redirect after 2 seconds (optional)
setTimeout(function() {
window.location.href = actblueLink.href;
}, 2000);
}
}
}
})();
</script>Then, the ActBlue link on your Thank You page needs to have an additional parameter at the end like refcodeSB={{ refcodeSB }} . It should look something like: https://secure.actblue.com/donate?amount=5&refcodeSB={{ refcodeSB }}
To test this, submit the Action Network form and it should redirect you to the ActBlue donation page. Check to make sure that donation page then has a query parameter in the URL like: refcodeSB=b-...-...