var mi_version = '9.2.2';
var mi_track_user = true;
var mi_no_track_reason = '';
var MonsterInsightsDefaultLocations = {"page_location":"http:\/\/helloaudience.co\/sponsor\/adopter-media\/"};
if ( typeof MonsterInsightsPrivacyGuardFilter === 'function' ) {
var MonsterInsightsLocations = (typeof MonsterInsightsExcludeQuery === 'object') ? MonsterInsightsPrivacyGuardFilter( MonsterInsightsExcludeQuery ) : MonsterInsightsPrivacyGuardFilter( MonsterInsightsDefaultLocations );
} else {
var MonsterInsightsLocations = (typeof MonsterInsightsExcludeQuery === 'object') ? MonsterInsightsExcludeQuery : MonsterInsightsDefaultLocations;
}
var disableStrs = [
'ga-disable-G-Z5903RNKW7',
];
/* Function to detect opted out users */
function __gtagTrackerIsOptedOut() {
for (var index = 0; index < disableStrs.length; index++) {
if (document.cookie.indexOf(disableStrs[index] + '=true') > -1) {
return true;
}
}
return false;
}
/* Disable tracking if the opt-out cookie exists. */
if (__gtagTrackerIsOptedOut()) {
for (var index = 0; index < disableStrs.length; index++) {
window[disableStrs[index]] = true;
}
}
/* Opt-out function */
function __gtagTrackerOptout() {
for (var index = 0; index < disableStrs.length; index++) {
document.cookie = disableStrs[index] + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStrs[index]] = true;
}
}
if ('undefined' === typeof gaOptout) {
function gaOptout() {
__gtagTrackerOptout();
}
}
window.dataLayer = window.dataLayer || [];
window.MonsterInsightsDualTracker = {
helpers: {},
trackers: {},
};
if (mi_track_user) {
function __gtagDataLayer() {
dataLayer.push(arguments);
}
function __gtagTracker(type, name, parameters) {
if (!parameters) {
parameters = {};
}
if (parameters.send_to) {
__gtagDataLayer.apply(null, arguments);
return;
}
if (type === 'event') {
parameters.send_to = monsterinsights_frontend.v4_id;
var hookName = name;
if (typeof parameters['event_category'] !== 'undefined') {
hookName = parameters['event_category'] + ':' + name;
}
if (typeof MonsterInsightsDualTracker.trackers[hookName] !== 'undefined') {
MonsterInsightsDualTracker.trackers[hookName](parameters);
} else {
__gtagDataLayer('event', name, parameters);
}
} else {
__gtagDataLayer.apply(null, arguments);
}
}
__gtagTracker('js', new Date());
__gtagTracker('set', {
'developer_id.dZGIzZG': true,
});
if ( MonsterInsightsLocations.page_location ) {
__gtagTracker('set', MonsterInsightsLocations);
}
__gtagTracker('config', 'G-Z5903RNKW7', {"forceSSL":"true","link_attribution":"true"} );
window.gtag = __gtagTracker; (function () {
/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
/* ga and __gaTracker compatibility shim. */
var noopfn = function () {
return null;
};
var newtracker = function () {
return new Tracker();
};
var Tracker = function () {
return null;
};
var p = Tracker.prototype;
p.get = noopfn;
p.set = noopfn;
p.send = function () {
var args = Array.prototype.slice.call(arguments);
args.unshift('send');
__gaTracker.apply(null, args);
};
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') {
if ('send' === arguments[0]) {
var hitConverted, hitObject = false, action;
if ('event' === arguments[1]) {
if ('undefined' !== typeof arguments[3]) {
hitObject = {
'eventAction': arguments[3],
'eventCategory': arguments[2],
'eventLabel': arguments[4],
'value': arguments[5] ? arguments[5] : 1,
}
}
}
if ('pageview' === arguments[1]) {
if ('undefined' !== typeof arguments[2]) {
hitObject = {
'eventAction': 'page_view',
'page_path': arguments[2],
}
}
}
if (typeof arguments[2] === 'object') {
hitObject = arguments[2];
}
if (typeof arguments[5] === 'object') {
Object.assign(hitObject, arguments[5]);
}
if ('undefined' !== typeof arguments[1].hitType) {
hitObject = arguments[1];
if ('pageview' === hitObject.hitType) {
hitObject.eventAction = 'page_view';
}
}
if (hitObject) {
action = 'timing' === arguments[1].hitType ? 'timing_complete' : hitObject.eventAction;
hitConverted = mapArgs(hitObject);
__gtagTracker('event', action, hitConverted);
}
}
return;
}
function mapArgs(args) {
var arg, hit = {};
var gaMap = {
'eventCategory': 'event_category',
'eventAction': 'event_action',
'eventLabel': 'event_label',
'eventValue': 'event_value',
'nonInteraction': 'non_interaction',
'timingCategory': 'event_category',
'timingVar': 'name',
'timingValue': 'value',
'timingLabel': 'event_label',
'page': 'page_path',
'location': 'page_location',
'title': 'page_title',
'referrer' : 'page_referrer',
};
for (arg in args) {
if (!(!args.hasOwnProperty(arg) || !gaMap.hasOwnProperty(arg))) {
hit[gaMap[arg]] = args[arg];
} else {
hit[arg] = args[arg];
}
}
return hit;
}
try {
f.hitCallback();
} catch (ex) {
}
};
__gaTracker.create = newtracker;
__gaTracker.getByName = newtracker;
__gaTracker.getAll = function () {
return [];
};
__gaTracker.remove = noopfn;
__gaTracker.loaded = true;
window['__gaTracker'] = __gaTracker;
})();
} else {
console.log("");
(function () {
function __gtagTracker() {
return null;
}
window['__gtagTracker'] = __gtagTracker;
window['gtag'] = __gtagTracker;
})();
}
http://helloaudience.co/wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend-gtag.min.js
var monsterinsights_frontend = {"js_events_tracking":"true","download_extensions":"doc,pdf,ppt,zip,xls,docx,pptx,xlsx","inbound_paths":"[{\"path\":\"\\\/go\\\/\",\"label\":\"affiliate\"},{\"path\":\"\\\/recommend\\\/\",\"label\":\"affiliate\"}]","home_url":"http:\/\/helloaudience.co","hash_tracking":"false","v4_id":"G-Z5903RNKW7"};
http://helloaudience.co/wp-includes/js/jquery/jquery.min.js
http://helloaudience.co/wp-includes/js/jquery/jquery-migrate.min.js
window.wp_data = {"ajax_url":"http:\/\/helloaudience.co\/wp-admin\/admin-ajax.php","ajax_nonce":"00fe398ca9","current_page":1,"max_page":1,"max_price":"86400","min_price":"5"};
jQuery(function ($) {
'use strict';
const urlOrigin = window.location.origin;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// If search page
let searchInput = $('.search-form input');
searchInput.on("focusout", function () {
$(this).closest('.search-form').find('.search-drop').fadeOut(300)
});
function decodeHtmlEntities(str) {
const doc = new DOMParser().parseFromString(str, 'text/html');
return doc.documentElement.textContent;
}
searchInput.on('keyup', function (event) {
let i;
let inp = $(this);
let val = $(this).val();
let dataAction = '';
let lowerCaseVal = val.toLowerCase();
if (event.keyCode == 13) {
let val = $(this).closest('.search-form').find('input').val()
window.location.replace(urlOrigin + '/search/?search=' + encodeURIComponent(val));
}
// console.log('Search val: ', val.length);
let primarySearchAudience = !!(inp.closest('.s-hero-home').hasClass('s-hero-home') && $('body').hasClass('home'));
let primarySearchSponsors = !!(inp.closest('.s-hero-home').hasClass('s-hero-home') && $('body').hasClass('page-template-sponsors-page'));
let secondarySearchAll = !!(inp.closest('.search-form').hasClass('sr-filter__group') || inp.closest('.search-form').hasClass('header__search-form'));
// Primary Search form
// Audience, Topics
if (primarySearchAudience) {
dataAction = 'data_fetch_home';
}
// Primary Search form
// Sponsors - Sponsors page
if (primarySearchSponsors) {
dataAction = 'data_fetch_sponsors';
}
// Secondary Search form
if (secondarySearchAll) {
dataAction = 'data_fetch';
}
jQuery.ajax({
url: window.wp_data.ajax_url,
type: 'post',
data: {
action: dataAction,
keyword: val.trim(),
},
success: function (data) {
let itemsArray = $.parseJSON(data);
// console.log('!!! --- itemsArray 0', itemsArray);
let itemsArrayData = [];
itemsArrayData = itemsArray.filter(item => item.category === false).map(item => ({
...item,
label: decodeHtmlEntities(item.label),
link: decodeHtmlEntities(item.link).replace(/=[^=]+$/, (val) => {
return '=' + encodeURIComponent(val.substr(1))
})
}));
itemsArray = itemsArray.filter(item => item.category).map(item => ({
...item,
label: decodeHtmlEntities(item.label),
link: decodeHtmlEntities(item.link).replace(/=[^=]+$/, (val) => {
return '=' + encodeURIComponent(val.substr(1))
})
}));
// console.log('!!! --- itemsArray', itemsArray);
let itemsArrayCategories = [];
let itemsArrayAudience = [];
let itemsArraySponsors = [];
let arrCatTarget = [];
// console.log("!!! --- itemsArrayData :", itemsArrayData);
for (i = 0; i < itemsArray.length; i++) {
if (itemsArray[i].category === true && itemsArray[i].audience === true) {
itemsArrayAudience.push(itemsArray[i]);
}
if (itemsArray[i].category === true && itemsArray[i].audience === false) {
itemsArrayCategories.push(itemsArray[i]);
}
if (itemsArray[i].category === true && itemsArray[i].sponsors === true) {
itemsArraySponsors.push(itemsArray[i]);
}
if (itemsArray[i].category === false && itemsArray[i].audience === false) {
itemsArrayData.push(itemsArray[i]);
}
}
// console.log('counts: ', itemsArraySponsors.length, itemsArrayCategories.length, itemsArrayAudience.length, itemsArrayData.length)
let searchBox = $('.search-drop__box');
searchBox.html('');
inp.closest('.search-form').find('.search-drop').fadeIn(300);
if (itemsArray.length === 0) {
searchBox.prepend('<div class="search-drop__title">No matches found. <a href="https://form.jotform.com/241399306807160" target="_blank">Request an Audience/Topic to add.</a></div>');
}
else {
// Primary Search form
// Audience, Topics
if (primarySearchAudience) {
// Display Audience
if (itemsArrayAudience.length === 0) {
// If Empty
} else {
searchBox.append('<div class="search-drop__title category">Audience</div>');
for (i = 0; i < itemsArrayAudience.length; i++) {
let lowerCaseTarget = decodeHtmlEntities(itemsArrayAudience[i].postType.toLowerCase());
if (lowerCaseTarget.includes(lowerCaseVal)) {
arrCatTarget.push(itemsArrayAudience[i]);
let textCategories = itemsArrayAudience[i].label;
let countAudience = itemsArrayAudience[i].postCount;
let countText = '';
if (countAudience === 1) {
countText = ' listing'
} else {
countText = ' listings'
}
let reCategories = new RegExp(`(${val})`, "gi");
let newTextCategories = textCategories.replace(reCategories, `<strong>$1</strong>`);
if (val !== '' && val.length > 0) {
searchBox.append('<div class="search-drop__list" role="menuitem" tabindex="0"><a href="' + itemsArrayAudience[i].link + '"><span class="title">' + newTextCategories + '</span> <span class="count">' + countAudience + countText + '</span></a></div>');
} else {
$('.search-form input').closest('.search-form').find('.search-drop').fadeOut(300)
return false;
}
}
}
}
// console.log('arrCatTarget: ', arrCatTarget);
// Display Categories
if (itemsArrayCategories.length === 0) {
// If Empty
} else {
searchBox.append('<div class="search-drop__title category">Topic</div>');
// console.log(itemsArrayCategories);
for (i = 0; i < itemsArrayCategories.length; i++) {
let lowerCaseTarget = decodeHtmlEntities(itemsArrayCategories[i].postType.toLowerCase());
if (lowerCaseTarget.includes(lowerCaseVal)) {
arrCatTarget.push(itemsArrayCategories[i]);
let textCategories = itemsArrayCategories[i].label;
let countCategories = itemsArrayCategories[i].postCount;
let countText = '';
if (countCategories === 1) {
countText = ' listing'
} else {
countText = ' listings'
}
let reCategories = new RegExp(`(${val})`, "gi");
let newTextCategories = textCategories.replace(reCategories, `<strong>$1</strong>`);
if (val !== '' && val.length > 0) {
searchBox.append('<div class="search-drop__list" role="menuitem" tabindex="0"><a href="' + itemsArrayCategories[i].link + '"><span class="title">' + newTextCategories + '</span> <span class="count">' + countCategories + countText + '</span></a></div></div>');
} else {
$('.search-form input').closest('.search-form').find('.search-drop').fadeOut(300)
return false;
}
}
}
}
}
// Primary Search form
// Sponsors - Sponsors page
if (primarySearchSponsors) {
// Display Sponsors
if (itemsArraySponsors.length === 0) {
// If Empty
} else {
searchBox.append('<div class="search-drop__title category">Sponsors</div>');
for (i = 0; i < itemsArraySponsors.length; i++) {
let lowerCaseTarget = decodeHtmlEntities(itemsArraySponsors[i].postType.toLowerCase());
if (lowerCaseTarget.includes(lowerCaseVal)) {
arrCatTarget.push(itemsArraySponsors[i]);
let textCategories = itemsArraySponsors[i].label;
let countSponsors = itemsArraySponsors[i].postCount;
let countText = '';
if (countSponsors === 1) {
countText = ' listing'
} else {
countText = ' listings'
}
let reCategories = new RegExp(`(${val})`, "gi");
let newTextCategories = textCategories.replace(reCategories, `<strong>$1</strong>`);
if (val !== '' && val.length > 0) {
searchBox.append('<div class="search-drop__list" role="menuitem" tabindex="0"><a href="' + itemsArraySponsors[i].link + '"><span class="title">' + newTextCategories + '</span> <span class="count">' + countSponsors + countText + '</span></a></div>');
} else {
$('.search-form input').closest('.search-form').find('.search-drop').fadeOut(300)
return false;
}
}
}
}
}
// Secondary Search form// Secondary Search form
if (secondarySearchAll) {
// Display Categories
if (itemsArrayCategories.length === 0) {
// If Empty
}
else {
for (i = 0; i < itemsArrayCategories.length; i++) {
let lowerCaseTarget = decodeHtmlEntities(itemsArrayCategories[i].postType.toLowerCase());
if (lowerCaseTarget.includes(lowerCaseVal)) {
arrCatTarget.push(itemsArrayCategories[i]);
let textCategories = itemsArrayCategories[i].label;
let reCategories = new RegExp(`(${val})`, "gi");
let newTextCategories = textCategories.replace(reCategories, `<strong>$1</strong>`);
if (val !== '' && val.length > 0) {
searchBox.append('<div class="search-drop__list" role="menuitem" tabindex="0"><a href="' + itemsArrayCategories[i].link + '"><span class="title">' + newTextCategories + '</span></a></div>');
} else {
$('.search-form input').closest('.search-form').find('.search-drop').fadeOut(300)
return false;
}
}
}
}
}
// Display Data
if (itemsArrayData.length === 0) {
// If Empty
}
else {
// console.log("!!! --- itemsArrayData :", itemsArrayData);
searchBox.append('<div class="search-drop__title category">Matching Listings</div>');
let postTypeName = itemsArrayData[0].postType;
for (i = 0; i < itemsArrayData.length; i++) {
// Show Post types
// if (i === 0 && itemsArrayData[0].postType.length > 0) {
// searchBox.append('<div class="search-drop__title">'+ itemsArrayData[i].postType +'</div>');
// }
//
// if (postTypeName !== itemsArrayData[i].postType && itemsArrayData[i].postType.length > 0) {
// searchBox.append('<div class="search-drop__title">'+ itemsArrayData[i].postType +'</div>');
// postTypeName = itemsArrayData[i].postType;
// }
let text = itemsArrayData[i].label;
let re = new RegExp(`(${val})`, "gi");
let newText = text.replace(re, `<strong>$1</strong>`);
if (val !== '' && val.length > 0) {
searchBox.append('<div class="search-drop__list" role="menuitem" tabindex="0"><a href="' + itemsArrayData[i].link + '"><span class="title">' + newText + '</span></a></div>');
} else {
$('.search-form input').closest('.search-form').find('.search-drop').fadeOut(300)
return false;
}
}
}
// Secondary Search form
if (secondarySearchAll) {
if (arrCatTarget.length !== 0) {
searchBox.prepend('<div class="search-drop__title category">Audience & Topic</div>');
}
}
// if (arrCatTarget.length !== 0) {searchBox.prepend('<div class="search-drop__title category">Audience & Topic</div>');}
if (arrCatTarget.length === 0 && itemsArrayData.length === 0) {
searchBox.prepend('<div class="search-drop__title">No matches found. <a href="https://form.jotform.com/241399306807160" target="_blank">Request an Audience/Topic to add.</a></div>');
}
}
}
});
});
$('.search-form .btn').on('click', function (event) {
let val = $(this).closest('.search-form').find('input').val()
window.location.replace(urlOrigin + '/search/?search=' + encodeURIComponent(val));
});
});
http://helloaudience.co/wp-content/themes/hello-audience/assets/js/hello-audience.min.js
setTimeout(function() {
var preloader = document.getElementById('loader-wrapper');
preloader.style.transition = 'opacity 0.5s';
preloader.style.opacity = '0';
setTimeout(function() {
preloader.style.display = 'none';
console.log('!!! --- Preloaded --- !!!');
}, 500); // Match the duration to your transition time
}, 200); // Delay by 1 second to ensure content is loaded