When running paid acquisition to direct new sign-up or subscribers to your site through Facebook or Google, it's possible to track the effectiveness of the campaign, especially with Hype there to support you! Below we will walk you through various options on how to track your paid acquisition campaigns using Hype.
Measuring ROAs
We first recommend maintaining and recording an accurate return-on-ad-spend (ROAS) from your campaigns.
Hype records UTM parameters (e.g., source, campaign, medium, content) that are included on a users initial load on your site, for both sign up and payment events. This conversion data is stored in the Hype CRM and can be downloaded at any time through a CSV export from your Contacts tab.
Please note that it may be possible for the sign-up UTM and payment UTM to be different if they occurred in separate user sessions.
Firing Conversion Events
For acquisition strategies that support changing live campaigns based on conversion events (i.e., events that stop targeting users that have already subscribed to Hype), it's possible to use additional JavaScript onsite.
This is an advanced integration and requires JavaScript development. This relies on Signals to identify when site visitors have converted to registered contacts or paying subscribers, in combination with a browser cookie to only send the conversion event once.
-
You'll first want to create an element that has the PicoSignal class. In the example code below, this is on a
div
. -
Next. you can add the code snippet below to your site.
In this example, both a Facebook and Google conversion tracking code is shown. Others can be included with thefireTrackingEvents()
method. To track events against Google Analytics, you'll need to have GA code installed on your site elsewhere. Where it says {your-pixel-id-goes-here} within the Facebook code, replace with your Pixel ID from Facebook as defined: https://developers.facebook.com/docs/facebook-pixel/implementation#base-code
var adCampaignPicoHandler = function(){
var REGISTERED_EVENT_CAPTURED = "ad-reg-event-captured";
var PAID_EVENT_CAPTURED = "ad-paid-event-captured";
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i <ca.length;i++) {="{">
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function fireTrackingEvents(){
fireFBevent(event);
fireGAevent(event);
//Other Tracking events can go here.
}
function fireGAevent(){
ga('send', 'event', event);
}
function fireFBevent(){
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{your-pixel-id-goes-here}');
fbq('trackSingleCustom', '{your-pixel-id-goes-here}', event);
}
var element = document.querySelector('div.PicoSignal');
var event = null
var observer = new MutationObserver(function(mutations) {
var hasSentRegistered = getCookie(REGISTERED_EVENT_CAPTURED);
var hasSentPayment = getCookie(PAID_EVENT_CAPTURED);
mutations.forEach(function(mutation) {
if (mutation.type == "attributes" && mutation.attributeName == "data-pico-status") {
if(element.getAttribute("data-pico-status") == "registered" && !hasSentRegistered){
event = "Registered"
fireTrackingEvents(event);
setCookie(REGISTERED_EVENT_CAPTURED,1,3650)
}
else if(element.getAttribute("data-pico-status") == "paying" && !hasSentPayment){
event ="Paying"
fireTrackingEvents(event);
setCookie(PAID_EVENT_CAPTURED,1,3650)
}
}
});
});
observer.observe(element, {
attributes: true
});
}
document.addEventListener('pico.loaded', adCampaignPicoHandler)
adCampaignPicoHandler()</ca.length;i++)>
For help setting up a Facebook or Google campaign to direct more traffic to your site, please reach out to Hype Support, and we'll put you in contact with our partners!