if(typeof(window.woopra)!='undefined'){
window.woopra.labels={"bjjv1w5e0w":{"color":"#795548","name":"ALL Organic Traffic","status":false},"7sr4wv2dbd":{"color":"#f44336","name":"High Intent (Scoring)","status":false},"wkgdjoursq":{"color":"#ffc107","name":"Attended A Webinar","status":false},"dbklqpy42q":{"color":"#ffc107","name":"ABM Enterprise (9.6.21)","status":false},"r9otbzfgpr":{"color":"#4caf50","name":"Requested Download (All)","status":false},"9wzfv78qpz":{"color":"#795548","name":"ALL Email Traffic","status":false},"qhamgh8sso":{"color":"#9c29b7","name":"Medium Intent (Scoring)","status":false},"gytotte2ji":{"color":"#795548","name":"ALL Backlink Traffic","status":false},"bcupcdso5v":{"color":"#607d8b","name":"Low Intent (Scoring)","status":true},"ecy3ge2oaw":{"color":"#795548","name":"ALL Internal Traffic","status":false},"ryprxypxlh":{"color":"#cddc39","name":"AMA Referrals (Returning Visits)","status":false},"1tsnzqxpaa":{"color":"#4caf50","name":"Requested Download (Returning Visits)","status":false},"k7p5qvoud8":{"color":"#795548","name":"ALL Direct Traffic","status":true},"xceusef4lo":{"color":"#8bc34a","name":"Irish Visitors (1st Visit)","status":false},"yh7c2ujvpv":{"color":"#607d8b","name":"Blog - Containing 'Skills'","status":false},"hmgddbogg9":{"color":"#cddc39","name":"AMA Referrals (1st Visit)","status":false},"qmlh6siu7l":{"color":"#8bc34a","name":"Irish Visitors (Returning)","status":false},"vnflwsll5c":{"color":"#795548","name":"ALL Social Network Traffic","status":false},"vgncwa8aoj":{"color":"#9c27b0","name":"PPC (Returning Visits)","status":false},"hoftl7co11":{"color":"#f44336","name":"AB Testing","status":false},"jr3eeebg1z":{"color":"#607d8b","name":"Blog - Containing 'Careers'","status":false},"8bbc5iv5po":{"color":"#607d8b","name":"Blog - Containing 'Beginners'","status":false},"vufa3wg21x":{"color":"#9c27b0","name":"PPC (1st Visit)","status":false}};
}
//output flow src_id=jzeoghhfkg app=system id=output
const this_test = "DMI039Woopra";
const ab_tests = "";
const ab_needle = 5;
const ab_result = ab_setup_woopra(ab_tests,this_test,ab_needle);


if(ab_result == "a"){

(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'yl4myuahpuasd5x6dxi8');

woopra.track("dynamic_change", {
    change: 'OIM Low Intent - Exit Intent DMI039'
});
  
} else if(ab_result == "b") {
  
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'h1ri0voruhbyqdx2lzr4');

  woopra.track("dynamic_change", {
    change: 'DMI039 Strategy Research Template Popup'
});
}

//output flow src_id=z0kriemo5s app=system id=output
//console.log('AD_SPACE TESTING');

// ================================================
// DO NOT MAKE DIRECT CHANGES TO THIS FILE!!!!
// ================================================
// This file is maintained in the MyDMI Repo.
// Make sure to update the code there and copy 
// and paste updates back into Woopra thereafter.
//
// Location: /resources/woopra-automation-scripts/nbp-convert-top-count-to-cookie.js

console.log("Last Campaign Value");
console.log('');

utmName = ''.toLowerCase();

variationName = "";

var activeCampaigns = optimizely.get('state').getCampaignStates({isActive:true});
var data = optimizely.get('data');
for (var key in activeCampaigns) {
  if (activeCampaigns.hasOwnProperty(key)) {
    variationId =  activeCampaigns[key].variation.id;
    variationName = data.variations[variationId].name;
  }
}

if(variationName == 'Original' || variationName == ''){
  if(utmName != '') {
    try{
      processAds(utmName);
      
      // Set to default while 0% Discount camapign is running 06.12.23
      // processAds('default');
    } catch (error) {
       // console.error(error);
    }
  }
}
// else {
//     // Extract the product view counts for this user and add to array
//     arr_product_count = [
//         0,
//         ,
//         ,
//         0,
//         ,
//         0,
//         ,
//         
//     ];
//
//     // FULL LIST
//     // arr_product_count = [
//     //     0,
//     //     ,
//     //     ,
//     //     0,
//     //     ,
//     //     0,
//     //     ,
//     //     ,
//     //     0,
//     //     0,
//     //     0,
//     //     0,
//     //     ,
//     //     0,
//     //     0,
//     //     0,
//     //     0,
//     //     ,
//     //     0,
//     //     0,
//     //     0,
//     // ];
//
//     // Replace "empty" with 0
//     arr_product_count = Array.from(arr_product_count, item => item || 0);
//
//     // arr_product_count = [
//     //     5,
//     //     2,
//     //     0,
//     //     3,
//     //     0,
//     //     1,
//     //     0,
//     //     2,
//     //     0,
//     //     0,
//     //     0,
//     //     0,
//     //     1,
//     //     0,
//     //     3,
//     //     0,
//     //     2,
//     //     0,
//     //     0,
//     //     0,
//     //     0,
//     // ];
//
//     // Match the product count array with an Ad Space name from Storyblok.
//     // Each of these should have an entry in Storyblok, here:
//     // https://app.storyblok.com/#!/me/spaces/55452/stories/0/0/index/89187752?page=1
//     arr_product_adspace = [
//         "pro-1",
//         "pro-ama-1",
//         "expert-1",
//         "expert-ama-1",
//         "sp-sm-1",
//         "sp-smm-1",
//         "sp-sp-1",
//         "master-1",
//     ];
//
//     // FUll LIST
//     // arr_product_adspace = [
//     //     "pro-ama-1",
//     //     "expert-1",
//     //     "pro-1",
//     //     "expert-ama-1",
//     //     "sp-sm-1",
//     //     "sp-smm-1",
//     //     "sp-sp-1",
//     //     "master-1",
//     //     "tr-contmar-1",
//     //     "tr-datanal-1",
//     //     "tr-ecom-1",
//     //     "tr-socmed-1",
//     //     "tr-uxweb-1",
//     //     "tr-seo-1",
//     //     "tr-ppc-1",
//     //     "tr-email-1",
//     //     "tr-display-1",
//     //     "tr-cx-1",
//     //     "tr-strat-1",
//     //     "sp-ss-1",
//     //     "foundation-1",
//     // ];
//
//     // Temp output the product count array during testing
//     console.log('PRODUCT_ARRAY');
//     console.log(arr_product_count);
//
//     // Get the highest value in the arr_product_count
//     max_product = Math.max(...arr_product_count);
//
//     // Retrieve the index of the highest value in the order of array
//     found_product = arr_product_count.findIndex(element => element >= max_product);
//     console.log('FOUND PRODUCT: ' + found_product);
//
//     // if the number was found in the array
//     if(found_product >= 0){
//
//         found_product_adspace = arr_product_adspace[found_product];
//
//         // Temp output the product found (index)
//         console.log(found_product);
//
//         // Temp output the adspace id for the found product
//         console.log(found_product_adspace);
//
//         // Show the Ad
//         processAds(found_product_adspace);
//
//     } else {
//         console.log("NBP Not Found")
//     }
// }


//output flow src_id=axrgh6zrei app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'aod3qkkipmialkxxtmb9');
//output flow src_id=i0o848g73e app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'ogbicxnbfhf5jqvuw6zi');

//output flow src_id=f7gnlxi6qo app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'otpnqcyny9mckvsjhqwj');
//output flow src_id=u0p0job5hn app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'qejydl72divxkcsccp7j');
//output flow src_id=bsisgy5e7a app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'cm56eylqxnpiuoejv6e5');
//output flow src_id=y8jcplzdvp app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'puj8lgc4kqoot6u9xduf');


//output flow src_id=gkeat1rb2p app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'ezmfsrxr863jldi7b4xo');
//output flow src_id=iebj4aovpn app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'exlkpo5mozhei7dhd7aa');
//output flow src_id=z1zlds2ic2 app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'zv70vldngl3q8wdnzf18');
//output flow src_id=depyjdcqp0 app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'kozf5hgayyqbbqgwf2ll');
//output flow src_id=qwu12foz3r app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'edl3uvsbd2agupalccep');
//output flow src_id=w4y7gtdswl app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'kkjec7gj4dxlf4y9wu0v');
//output flow src_id=ls2sjkkm3j app=system id=output
(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,9998,'sl4deucbe0efjbkj9mkb');

//output flow src_id=jg0auzeqpu app=system id=output
ga('send', 'event', 'dmi-intent', 'low', 'low', 1, {'nonInteraction': 1});
//output flow src_id=z39ogddd7n app=system id=output
$("#js_master_cta").empty().html('<a id="master-signin" href="https://my.digitalmarketinginstitute.com/auth/login?totf-signin" class="signin un" style="display:inline-block">Sign In</a><a id="master-join" href="https://my.digitalmarketinginstitute.com/auth/register?totf-join-dmi" class="join" style="display:inline-block">Join for FREE</a>');

//output flow src_id=z39ogddd7n app=system id=output
var optValue = sessionStorage.optactive;
if(optValue !== 'true'){
  console.log('Woopra Triggered - Sticky Content');
  $("#js_related_lessons_block").toggleClass('hide');
  $("#js_related_content_block").toggleClass('hide');
  
    woopra.track("dynamic_change", {
      change: 'Low Intent Sticky Content'
  });
}



