Prepping On A Budget: The 7 Rules You Need To Know


Prepping On A Budget: The 7 Rules You Need To Know -1; } /* Disable tracking if the opt-out cookie exists. */ if ( __gaTrackerIsOptedOut() ) { window[disableStr] = true; } /* Opt-out function */ function __gaTrackerOptout() { document.cookie = disableStr + ‘=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/’; window[disableStr] = true; } if ( ‘undefined’ === typeof gaOptout ) { function gaOptout() { __gaTrackerOptout(); } } if ( mi_track_user ) { (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’__gaTracker’); __gaTracker(‘create’, ‘UA-154968002-1’, ‘auto’); __gaTracker(‘set’, ‘forceSSL’, true); __gaTracker(‘require’, ‘displayfeatures’); __gaTracker(‘require’, ‘linkid’, ‘linkid.js’); __gaTracker(‘send’,’pageview’); } else { console.log( “” ); (function() { /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ var noopfn = function() { return null; }; var noopnullfn = function() { return null; }; var Tracker = function() { return null; }; var p = Tracker.prototype; p.get = noopfn; p.set = noopfn; p.send = noopfn; var __gaTracker = function() { var len = arguments.length; if ( len === 0 ) { return; } var f = arguments[len-1]; if ( typeof f !== ‘object’ || f === null || typeof f.hitCallback !== ‘function’ ) { console.log( ‘Not running function __gaTracker(‘ + arguments[0] + ” ….) because you are not being tracked. ” + mi_no_track_reason ); return; } try { f.hitCallback(); } catch (ex) { } }; __gaTracker.create = function() { return new Tracker(); }; __gaTracker.getByName = noopnullfn; __gaTracker.getAll = function() { return []; }; __gaTracker.remove = noopfn; window[‘__gaTracker’] = __gaTracker; })(); } ]]> 0 ) { powerkitButtonsIds.push( $( this ).attr( ‘data-id’ ) ); } }); // Generate accounts data. var powerkitButtonsData = {}; if( powerkitButtonsIds.length > 0 ) { powerkitButtonsData = { ‘ids’ : powerkitButtonsIds.join(), ‘post_id’ : powerkitButtonsBox.attr( ‘data-post-id’ ), ‘url’ : powerkitButtonsBox.attr( ‘data-share-url’ ), }; } // Get results by REST API. $.ajax({ type: ‘GET’, url: ‘https://thepreparednessexperience.com/wp-json/social-share/v1/get-shares’, data: powerkitButtonsData, beforeSend: function(){ // Add Loading Class. powerkitButtonsBox.addClass( ‘pk-share-buttons-loading’ ); }, success: function( response ) { if ( ! $.isEmptyObject( response ) && ! response.hasOwnProperty( ‘code’ ) ) { // Accounts loop. $.each( response, function( index, data ) { if ( index !== ‘total_count’ ) { // Find Bsa Item. var powerkitButtonsItem = powerkitButtonsBox.find( ‘.pk-share-buttons-item[data-id=”‘ + index + ‘”]’); // Set Count. if ( data.hasOwnProperty( ‘count’ ) && data.count ) { powerkitButtonsItem.removeClass( ‘pk-share-buttons-no-count’ ).addClass( ‘pk-share-buttons-item-count’ ); powerkitButtonsItem.find( ‘.pk-share-buttons-count’ ).html( data.count ); } else { powerkitButtonsItem.addClass( ‘pk-share-buttons-no-count’ ); } } }); if ( powerkitButtonsBox.hasClass( ‘pk-share-buttons-has-total-counts’ ) && response.hasOwnProperty( ‘total_count’ ) ) { var powerkitButtonsTotalBox = powerkitButtonsBox.find( ‘.pk-share-buttons-total’ ); if ( response.total_count ) { powerkitButtonsTotalBox.find( ‘.pk-share-buttons-count’ ).html( response.total_count ); powerkitButtonsTotalBox.show().removeClass( ‘pk-share-buttons-total-no-count’ ); } } } // Remove Loading Class. powerkitButtonsBox.removeClass( ‘pk-share-buttons-loading’ ); }, error: function() { // Remove Loading Class. powerkitButtonsBox.removeClass( ‘pk-share-buttons-loading’ ); } }); }); }); })(jQuery); ]]>

Source

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.