Using a Custom Tracking System within Justuno

Method 1 (preferred)

With this method, you will actually place the following code on your own site and it will be effective for any Justuno Promotions on your site:

<script>
window.ju_custom_event = function(email, eventname, promotitle, step, cmid, options, data){

/*
/// Below are the different values possible for [eventname]

// the first two are impressions
Targeted Overlay
Tab Click

// the rest here are engagements
Engagement - Facebook
Engagement - Google Plus
Engagement - Twitter Tweet
Engagement - Email Signup
Engagement - LinkedIn Share
Engagement - Twitter Follow
Engagement - Pinterest Follow
Engagement - Instagram Follow
Engagement - Videos Watched
Engagement - Incentivized Form
Engagement - VK Follow
Engagement - Reddit Subscribe
Engagement - Google Follow
Engagement - LinkedIn Follow
Engagement - Unlocked Click
Engagement - Intro Continue Click
Engagement - Unlocked View
Engagement - Plugin

/// step is either 1 for impression or 2 for engagement

/// cmid is the promotion ID

// options is an object that contains a few different properties.
options.promo_coupon // this would be the coupon code that was given to the user in that promotion
options.ruleId // this is the targeting rule ID that initiated the promo
options.exit // this is either 1 for yes or 0 for no, meaning yes this was fired because of an exit rule.
*/


// example to fire an event for promotion impression (when promotion is shown)
if (step==1){
// do something
}

// example to fire an event for promotion engaged (any type of engagement)
if (step==2){
// do something
}

// example to fire an event for promotion engaged (email only)
if (step==2 && email!=''){
// do something
}

// data will be an array of field objects like the following example
// [{"name":"email","value":"info@xyz.com"},{"name":"firstname","value":"John"},{"name":"lastname","value":"Smith"}]

}
</script>

Method 2 (per promotion)

If you have a specific tracking system that we do not have and would like to insert it into Justuno you can do so through this call back:

function ju_callback(t,email,coupon) {
jju.getScript( "//ENTER IN YOUR TRACKING", function( data, textStatus, jqxhr ) {// do something on load});

/*
For your reference, the t variable that gets passed to the call back will equal one of these depending on your engagement type:
t = engagementType int
The different types are below

0 = Auto engagement for an unlocked offer
1 = Engagement - Facebook
2 = Engagement - Google Plus
3 = Engagement - Twitter Tweet
4 = Engagement - Email Signup
5 = Engagement - LinkedIn Share
6 = Engagement - Twitter Follow
7 = Engagement - Pinterest Follow
8 = Engagement - Instagram Follow
9 = Engagement - Videos Watched
10 = Engagement - Incentivized Form
11 = Engagement - VK Follow
12 = Engagement - Reddit Subscribe
13 = Engagement - Google Follow
14 = Engagement - LinkedIn Follow
15 = Engagement - Unlocked Click
16 = Engagement - Intro Continue Click
17 = Engagement - Unlocked View
18 = Engagement - Plugin

1000 = auto engagement for a previous engagement during a session
*/
}



Method 2 Use Cases:

Facebook Pixel fire upon incentivized form or email submission (code is recommended to be inserted into the TabJS custom code section, but PopupJS may function as well).

function ju_callback(t,email){

if (t==4 || t==10){ // this line means it will only fire the code after an email or incentivized form engagement


//FAECBOOK PIXEL CODE

!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','//connect.facebook.net/en_US/fbevents.js');

fbq('init', ''); //include this call if your Pixel hasn't already been initialized elsewhere on the page
fbq('track', "PageView");
fbq('track', "Lead");
//for custom conversion track specific to Justuno promos use fbq('trackCustom', 'MyCustomEvent', {custom_param: 'custom_value'});
}
}

Google Pixel fire upon incentivized form or email submission (code is recommended to be inserted into the TabJS custom code section, but PopupJS may function as well).

function ju_callback(t,email){

if (t==4 || t==10){ // this line means it will only fire the code after an email or incentivized form engagement

//GOOGLE PIXEL CODE
//We have found the <noscript>snippet</noscript> route of the Google Pixel code to function well within the ju_callback function, but the standard script route is shown below.
//window.google_conversion_id = <PIXEL_ID>;
//window.google_conversion_label = "CONVERSION_LABEL";
//window.google_remarketing_only = false;
//jju.getScript("//www.googleadservices.com/pagead/conversion_async.js");


jju('body').append('<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/<GENERATED Google Conversion Id>/?label=<GENERATED Google Conversion Label>&script=0"/>');

}
}