<commit_before>/* ===================================================================
    Facebook/Google Tracking
====================================================================== */

function track_event(name, category, value) {
    
    // Track Facebook
    fbq('trackCustom', name, {
        event_category: category,
        event_val: value 
    });
    
    // Track Google
    ga('send', {
        hitType: 'event',
        eventCategory: category,
        eventAction: name,
        eventLabel: value
    });
    
}

jQuery(function($) {    
    
    // Scroll Depth Tracking 
    var quarter = half = threeQuarter = whole = false;
    
    $(window).scroll(function() {
        
        var s = $(window).scrollTop(),
            d = $(document).height(),
            c = $(window).height();

        var scrollPercent = (s / (d-c)) * 100;
        
        if ( scrollPercent == 100 && whole === false) {
            track_event('scroll', 'scroll-depth', '100');
            whole = true;
        } else if (scrollPercent >= 75 && threeQuarter === false) {
            track_event('scroll', 'scroll-depth', '75');
            threeQuarter = true;
        } else if (scrollPercent >= 50 && half === false) {
            track_event('scroll', 'scroll-depth', '50');
            half = true;
        } else if (scrollPercent >= 25 && quarter === false) {
            track_event('scroll', 'scroll-depth', '25');
            quarter = true;
        }
        
    });
    
    // Stopgap solution for events on registration links @todo
    $('.register-episode-1').on('click', function() {
        track_event('register', 'leadership-series', 'top');
    });
    
    $('.register-episode-1a').on('click', function() {
        track_event('register', 'leadership-series', 'bottom');
    });
});
<commit_msg>Adding tracking code for South Africa<commit_after>/* ===================================================================
    Facebook/Google Tracking
====================================================================== */

function track_event(name, category, value) {
    
    // Track Facebook
    fbq('trackCustom', name, {
        event_category: category,
        event_val: value 
    });
    
    // Track Google
    ga('send', {
        hitType: 'event',
        eventCategory: category,
        eventAction: name,
        eventLabel: value
    });
    
}

jQuery(function($) {    
    
    // Scroll Depth Tracking 
    var quarter = half = threeQuarter = whole = false;
    
    $(window).scroll(function() {
        
        var s = $(window).scrollTop(),
            d = $(document).height(),
            c = $(window).height();

        var scrollPercent = (s / (d-c)) * 100;
        
        if ( scrollPercent == 100 && whole === false) {
            track_event('scroll', 'scroll-depth', '100');
            whole = true;
        } else if (scrollPercent >= 75 && threeQuarter === false) {
            track_event('scroll', 'scroll-depth', '75');
            threeQuarter = true;
        } else if (scrollPercent >= 50 && half === false) {
            track_event('scroll', 'scroll-depth', '50');
            half = true;
        } else if (scrollPercent >= 25 && quarter === false) {
            track_event('scroll', 'scroll-depth', '25');
            quarter = true;
        }
        
    });
    
    // Stopgap solution for events on registration links @todo
    $('.register-episode-1').on('click', function() {
        track_event('register', 'leadership-series', 'top');
    });
    
    $('.register-episode-1a').on('click', function() {
        track_event('register', 'leadership-series', 'bottom');
    });
    
    $('.sa-track').on('click', function() {
        var data = $(this).attr('data-track');
        track_event(data, 'sa', 'click');
    })
});

{'fraction_non_alphanumeric': 0.22406094037299712, 'fraction_numerical': 0.012083004990806409, 'mean_word_length': 2.186610878661088, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4604649', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1007, 'n_words': 233}