window.wpmDataLayer = window.wpmDataLayer || {};
window.wpmDataLayer = Object.assign(window.wpmDataLayer, {"cart":{},"cart_item_keys":{},"version":{"number":"1.49.1","pro":false,"eligible_for_updates":false,"distro":"fms","beta":false,"show":true},"pixels":{"google":{"linker":{"settings":null},"user_id":false,"ads":{"conversion_ids":{"AW-1013353367":"pbh1COqgk6EaEJeXmuMD"},"dynamic_remarketing":{"status":true,"id_type":"post_id","send_events_with_parent_ids":true},"google_business_vertical":"retail","phone_conversion_number":"","phone_conversion_label":""},"tag_id":"AW-1013353367","tag_gateway":{"measurement_path":""},"tcf_support":false,"consent_mode":{"is_active":true,"wait_for_update":500,"ads_data_redaction":false,"url_passthrough":true}}},"shop":{"list_name":"","list_id":"","page_type":"","currency":"USD","selectors":{"addToCart":[],"beginCheckout":[]},"order_duplication_prevention":true,"view_item_list_trigger":{"test_mode":false,"background_color":"green","opacity":0.5,"repeat":true,"timeout":1000,"threshold":0.8},"variations_output":true,"session_active":false},"page":{"id":16160,"title":"When will my purchase be shipped?","type":"ufaq","categories":[],"parent":{"id":0,"title":"When will my purchase be shipped?","type":"ufaq","categories":[]}},"general":{"user_logged_in":false,"scroll_tracking_thresholds":[],"page_id":16160,"exclude_domains":[],"server_2_server":{"active":false,"ip_exclude_list":[],"pageview_event_s2s":{"is_active":false,"pixels":[]}},"consent_management":{"explicit_consent":false},"lazy_load_pmw":false}});
window.FacebookSignals = window.FacebookSignals || {
_held: false,
_queue: [],
_config: {},
_attribution: {},
_seenEventIds: {},
_fbclid: (function() {
try {
var m = window.location.search.match(/[?&]fbclid=([^&]*)/);
return m ? decodeURIComponent(m[1]) : null;
} catch(e) { return null; }
})(),
init: function(config) {
config = config || {};
this._config = config;
this._attribution = config.attribution || {};
this._held = !!config.held;
this._fbclid = this._fbclid || null;
try {
var raw = window.sessionStorage.getItem('wc_facebook_signals_seen_event_ids');
this._seenEventIds = raw ? JSON.parse(raw) : {};
} catch (e) {
this._seenEventIds = this._seenEventIds || {};
}
},
queueEvent: function(eventData) {
if (!eventData || !eventData.event_name) return;
if (eventData.event_id && this._seenEventIds[eventData.event_id]) return;
eventData.event_time = eventData.event_time || Math.floor(Date.now() / 1000);
this._queue.push(eventData);
if (eventData.event_id) {
this._seenEventIds[eventData.event_id] = 1;
try {
window.sessionStorage.setItem(
'wc_facebook_signals_seen_event_ids',
JSON.stringify(this._seenEventIds)
);
} catch (e) {}
}
},
trackEvent: function(name, params, userData) {
if (this._held) {
this.queueEvent({
event_name: name,
custom_data: params || {},
user_data: userData || {},
event_id: (params && params.eventID) || null,
event_time: Math.floor(Date.now() / 1000)
});
} else {
if (params && params.eventID) {
fbq('track', name, params, { eventID: params.eventID });
} else {
fbq('track', name, params);
}
}
},
release: function() {
var self = this;
if (!self._held || !self._config.ajaxUrl) {
return Promise.resolve({ success: true, data: { sent_count: 0 } });
}
var payload = JSON.stringify({
security: self._config.nonce,
events: self._queue,
attribution: {
fbp: self._attribution.fbp || null,
fbc: self._attribution.fbc || null
}
});
// Pass action as a query parameter so WordPress can route the request.
var url = self._config.ajaxUrl +
(self._config.ajaxUrl.indexOf('?') === -1 ? '?' : '&') +
'action=' + encodeURIComponent(self._config.action);
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
if (xhr.status >= 200 && xhr.status < 300) {
try {
var resp = JSON.parse(xhr.responseText);
self._handleReleaseResponse(resp.data || {});
resolve(resp);
} catch(e) { reject(e); }
} else {
reject(new Error('Signal release AJAX failed: ' + xhr.status));
}
};
xhr.onerror = function() { reject(new Error('Network error')); };
xhr.send(payload);
});
},
_handleReleaseResponse: function(data) {
this._syncAttributionCookies(data || {});
// Re-enable the browser signal path so fbevents.js starts firing.
fbq('consent', 'grant');
// Replay queued events via the pixel.
var queue = this._queue;
for (var i = 0; i < queue.length; i++) {
var ev = queue[i];
if (ev.event_id) {
fbq('track', ev.event_name, ev.custom_data || {}, { eventID: ev.event_id });
} else {
fbq('track', ev.event_name, ev.custom_data || {});
}
}
// Clear the queue and mark signals as active again.
this._queue = [];
this._held = false;
},
_syncAttributionCookies: function(data) {
var clientParams = {};
if (typeof clientParamBuilder !== 'undefined') {
try {
// Let the client-side ParamBuilder generate/set missing attribution
// cookies using its normal domain-scoping logic.
clientParams = clientParamBuilder.processAndCollectParams(this._getAttributionUrl()) || {};
} catch (e) {}
}
var fbp = data.fbp || clientParams._fbp || (typeof clientParamBuilder !== 'undefined' ? clientParamBuilder.getFbp() : null);
var fbc = data.fbc || clientParams._fbc || (typeof clientParamBuilder !== 'undefined' ? clientParamBuilder.getFbc() : null);
// If the backend supplied exact values used for CAPI, write them so Pixel
// replay and CAPI use matching attribution.
if (data.fbp) {
this._setAttributionCookie('_fbp', fbp, data.fbp_domain || data.cookie_domain || this._attribution.fbpDomain);
}
if (data.fbc) {
this._setAttributionCookie('_fbc', fbc, data.fbc_domain || data.cookie_domain || this._attribution.fbcDomain || this._attribution.fbpDomain);
}
},
_setAttributionCookie: function(name, value, domain) {
if (!value) return;
var domainAttr = domain ? ';domain=' + domain : '';
document.cookie = name + '=' + encodeURIComponent(value) + ';path=/;max-age=7776000' + domainAttr + ';SameSite=Lax';
},
_getAttributionUrl: function() {
if (!this._fbclid) {
return window.location.href;
}
try {
var url = new URL(window.location.href);
if (!url.searchParams.get('fbclid')) {
url.searchParams.set('fbclid', this._fbclid);
}
return url.toString();
} catch (e) {
return window.location.href;
}
}
};
fbq('init', '2846271042179391', {}, {
"agent": "woocommerce_6-10.7.0-3.7.0"
});
FacebookSignals.init({ held: false });
document.addEventListener( 'DOMContentLoaded', function() {
// Insert placeholder for events injected when a product is added to the cart through AJAX.
document.body.insertAdjacentHTML( 'beforeend', '<div class=\"wc-facebook-pixel-event-placeholder\"></div>' );
}, false );
( function( w, d, s, l, i ) {
w[l] = w[l] || [];
w[l].push( {'gtm.start': new Date().getTime(), event: 'gtm.js'} );
var f = d.getElementsByTagName( s )[0],
j = d.createElement( s ), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://mbaseballacademy.com/wp-content/uploads/breeze/google/gtm.js?id=' + i + dl;
f.parentNode.insertBefore( j, f );
} )( window, document, 'script', 'dataLayer', 'GTM-PX3FVZGB' );
tvc_js = new TVC_GTM_Enhanced({"affiliation":"Marietta Baseball Academy","is_admin":"","tracking_option":"","property_id":"","measurement_id":"","google_ads_id":"","fb_pixel_id":"","fb_event_id":"e2aa20a191eb4e96a638c0a1f13fac0e","tvc_ajax_url":"https:\/\/mbaseballacademy.com\/wp-admin\/admin-ajax.php","is_global_fs_enabled":null});
/*
* Contact form 7 - formSubmit event
*/
var wpcf7Elm = document.querySelector('.wpcf7');
if (wpcf7Elm) {
wpcf7Elm.addEventListener('wpcf7submit', function(event) {
if (event.detail.status == 'mail_sent') {
tvc_js.formsubmit_cf7_tracking(event);
}
}, false);
}
/*
* Global - jjQuery event handler that is triggered when an AJAX request completes successfully.
*/
jQuery(document).ajaxSuccess(function(event, xhr, settings) {
// WpForm - formSubmit event
if (settings.data instanceof FormData) {
var formdata = [];
for (var pair of settings.data.entries()) {
if ('form_id' in formdata && 'action' in formdata)
break;
if (pair[0] == 'wpforms[id]')
formdata['form_id'] = pair[1];
if (pair[0] == 'action' && pair[1] == 'wpforms_submit')
formdata['action'] = pair[1];
}
if (formdata['action'] == 'wpforms_submit' && settings.data != 'action=datalayer_push') {
var data = [];
tvc_js.formsubmit_ajax_tracking(formdata);
return;
}
}
});
var question_titles = ["When will my purchase be shipped?"]
var ewd_ufaq_php_data = {"retrieving_results":"Retrieving Results","question_titles":["When will my purchase be shipped?"],"display_faq":"0","nonce":"8c5895bd11"}
document.addEventListener('DOMContentLoaded', function() {
var downloadLinks = document.querySelectorAll('a[href]');
downloadLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
var fileUrl = link.href;
var fileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
var linkText = link.innerText || link.textContent;
var linkUrl = link.href;
var fileExtensionPattern = /\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pptx?|ppt|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/i;
if (fileExtensionPattern.test(fileUrl)) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'file_download',
file_name: fileName,
link_text: linkText,
link_url: linkUrl
});
}
});
});
});
( function() {
var skipLinkTarget = document.querySelector( 'main' ),
sibling,
skipLinkTargetID,
skipLink;
// Early exit if a skip-link target can't be located.
if ( ! skipLinkTarget ) {
return;
}
/*
* Get the site wrapper.
* The skip-link will be injected in the beginning of it.
*/
sibling = document.querySelector( '.wp-site-blocks' );
// Early exit if the root element was not found.
if ( ! sibling ) {
return;
}
// Get the skip-link target's ID, and generate one if it doesn't exist.
skipLinkTargetID = skipLinkTarget.id;
if ( ! skipLinkTargetID ) {
skipLinkTargetID = 'wp--skip-link--target';
skipLinkTarget.id = skipLinkTargetID;
}
// Create the skip link.
skipLink = document.createElement( 'a' );
skipLink.classList.add( 'skip-link', 'screen-reader-text' );
skipLink.id = 'wp-skip-link';
skipLink.href = '#' + skipLinkTargetID;
skipLink.innerText = 'Skip to content';
// Inject the skip link.
sibling.parentElement.insertBefore( skipLink, sibling );
}() );
//# sourceURL=wp-block-template-skip-link-js-after
var iconic_wsb_frontend_vars = {"ajax_url":"/wp-admin/admin-ajax.php","nonce":"5f1833a120","fbt_use_ajax":"1","is_checkout":"","i18n":{"error":"Please Try Again","success":"Added to Cart","add_selected":"Add Selected to Cart","disabled_add_to_cart":"Please select a variation before adding the selected products to your cart."},"modal_options":{"showCloseBtn":false}};
//# sourceURL=iconic_wsb_frontend_scripts-js-extra
Leave a Reply