[]
{let choices = {};if (beacon) {choices = { technique: ‘beacon’ };}edgetag(‘tag’, identify, payload, {}, choices);};const sendUser = (person) => {if (!person || !Object.keys(person).size) {return;}edgetag(‘knowledge’, person);};const getUser = (kind, selectors) => {const person = {};if (!selectors) {return person;}Object.entries(selectors).forEach(([userKey, selector]) => {if (!selector || selector.size === 0) {return;}const selectorArray = Array.isArray(selector) ? selector : [selector];for (const selector of selectorArray) {if (!selector) {proceed;}const inputUserValue = kind.querySelector(selector);const userValue = (inputUserValue && inputUserValue.worth) || ”;if (userValue) {person[userKey] = userValue;break;}}});return person;};const getLocalCurrency = () => {if (window.Shopify && window.Shopify.forex && window.Shopify.forex.lively) {return window.Shopify.forex.lively.toUpperCase();}return ‘USD’;};const newsletterFormSelectors = [‘#ContactFooter’,’.klaviyo-form’,’#wisepops-root’,’#contact_form’,’form[id*=”newsletter” i]’,’kind[id*=”subscribe” i]’,’kind.ml-block-form’];const newsletterForm = newsletterFormSelectors.be a part of(‘,’);const actions = [{selectors: [‘[type=”submit”]’, ‘kind[action=”/account/login”]’],size: 2,enjoyable: (ele) => {const person = getUser(ele, {e-mail: ‘enter[type=”email”]’});sendUser(person);},present: 0},{selectors: [‘[type=”submit”]’, ‘kind[action=”/account”]’],size: 2,enjoyable: (ele) => {let person = getUser(ele, {e-mail: ‘enter[type=”email”]’,telephone: ‘enter[type=”tel”]’,firstName: ‘enter[name*=”first” i]:not([type=”hidden” i])’,lastName: ‘enter[name*=”last” i]:not([type=”hidden” i])’});if (!person.firstName && !person.lastName) {person = {…person,…getUser(ele, { firstName: ‘enter[name*=”name” i]’ })};}sendUser(person);edgetag(‘tag’, ‘CompleteRegistration’);},present: 0},{selectors: [‘[type=”submit”]’, newsletterForm],size: 2,enjoyable: (ele) => {const person = getUser(ele, {e-mail: [‘input[type=”email”]’, ‘enter[name*=”email” i]:not([type=”hidden” i]’],telephone: [‘input[type=”tel”]’, ‘enter[name*=”phone” i]:not([type=”hidden” i]’],firstName: ‘enter[name*=”name” i]:not([type=”hidden” i]’,dateOfBirth: ‘enter[name*=”birthday” i]:not([type=”hidden” i]’});sendUser(person);edgetag(‘tag’, ‘Subscribe’, {}, {}, { technique: ‘beacon’ });},present: 0},{selectors: [‘button’, newsletterForm],size: 2,enjoyable: (ele) => {const person = getUser(ele, {e-mail: [‘input[type=”email”]’, ‘enter[name*=”email” i]:not([type=”hidden” i]’],telephone: [‘input[type=”tel”]’, ‘enter[name*=”phone” i]:not([type=”hidden” i]’],firstName: ‘enter[name*=”name” i]:not([type=”hidden” i]’,dateOfBirth: ‘enter[name*=”birthday” i]:not([type=”hidden” i]’});sendUser(person);edgetag(‘tag’, ‘Subscribe’, {}, {}, { technique: ‘beacon’ });},present: 0},{selectors: [‘[type=”submit”]’, ‘kind[action^=”/contact”]’],size: 2,enjoyable: (ele) => {const person = getUser(ele, {e-mail: [‘input[type=”email”]’, ‘enter[name*=”email” i]:not([type=”hidden” i]’],telephone: [‘input[type=”tel”]’, ‘enter[name*=”phone” i]:not([type=”hidden” i]’],firstName: [‘input[name*=”first” i]:not([type=”hidden” i]’, ‘enter[name*=”name” i]:not([type=”hidden” i]’, ‘enter[name*=”nom” i]:not([type=”hidden” i]’],lastName: ‘enter[id*=”last” i]:not([type=”hidden” i]’});sendUser(person);edgetag(‘tag’, ‘Contact’);},present: 0}];const resetActions = () => {for (let i = 0; i {if (!factor || factor.nodeName === ‘BODY’) {resetActions();return}if (factor.nodeName !== ‘DIV’ && factor.nodeName !== ‘INPUT’ && factor.nodeName !== ‘A’ && factor.nodeName !== ‘BUTTON’ && factor.nodeName !== ‘FORM’) {checkElement(factor.parentElement);return}for (let i = 0; i {const isDuplicate = () => {if (!cartProcessedItems || !Array.isArray(cartProcessedItems) || !cartProcessedItems.size) {return false;}const currentTimestamp = Date.now();cartProcessedItems = cartProcessedItems.filter(merchandise => (currentTimestamp – merchandise.timestamp) merchandise.payload === payloadString && merchandise.requestType !== requestType);} catch {return false;}};if (!payload || !Array.isArray(payload) || !payload.size) {return;}if (!requestType) {console.error(“[EdgeTag] Request Sort is lacking in sendData”);}if (isDuplicate()) {return;}payload.forEach(merchandise => {if (merchandise.value == null || merchandise.value === “” || !merchandise.id) {return;}edgetag(‘tag’, ‘AddToCart’, {forex: getLocalCurrency(),worth: parseFloat(merchandise.value) / 100,contents: [{id: item.product_id?.toString(),variantId: item.variant_id?.toString(),sku: item.sku,quantity: 1,item_price: parseFloat(item.price) / 100,title: item.title,category: item.product_type,image: item.image,brand: item.vendor,url: window.origin + item.url,type: ‘product’,}]}, {}, { technique: ‘beacon’ });});cartProcessedItems.push({requestType,payload: JSON.stringify(payload),timestamp: Date.now()});};const networkListener = operate() {const fetch = window.fetch; window.fetch = operate() { return fetch.apply(this, Array.prototype.slice.name(arguments)).then(operate(t) { if (!t || !t.okay || !t.url) {return t; } attempt {if (t.url.indexOf(“/cart/add”) !== -1) {const myResponse = t.clone();Promise.resolve(myResponse.json()).then(e => {if (!e) {return;}const payload = e.objects ? e.objects : [e];sendCartData(payload, ‘fetch’);});return t;} } catch (e) { } return t; }); };const origOpen = XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open = operate() {this.addEventListener(‘load’, operate() {if (!this._url) {return;}if (this._url.indexOf(“/cart/add”) !== -1) {attempt {const e = JSON.parse(this.responseText);if (!e) {return;}const payload = e.objects ? e.objects : [e];sendCartData(payload, ‘XMLHttpRequest’);} catch (e) {}return;}});origOpen.apply(this, arguments);};};networkListener();edgetag(‘tag’, ‘PageView’);const present = {“id”:40388560814165,”title”:”Default Title”,”option1″:”Default Title”,”option2″:null,”option3″:null,”sku”:”2058″,”requires_shipping”:true,”taxable”:true,”featured_image”:null,”out there”:true,”identify”:”3-Month Survival Meals Equipment”,”public_title”:null,”choices”:[“Default Title”],”value”:69995,”weight”:40415,”compare_at_price”:null,”inventory_management”:null,”barcode”:”810026144936″,”requires_selling_plan”:false,”selling_plan_allocations”:[{“price_adjustments”:[{“position”:1,”price”:66495}],”value”:66495,”compare_at_price”:69995,”per_delivery_price”:66495,”selling_plan_id”:5008883797,”selling_plan_group_id”:”44d12b8db8104584d7d07c5390f6a8a2e82f9b59″},{“price_adjustments”:[{“position”:1,”price”:66495}],”value”:66495,”compare_at_price”:69995,”per_delivery_price”:66495,”selling_plan_id”:5008916565,”selling_plan_group_id”:”44d12b8db8104584d7d07c5390f6a8a2e82f9b59″},{“price_adjustments”:[{“position”:1,”price”:66495}],”value”:66495,”compare_at_price”:69995,”per_delivery_price”:66495,”selling_plan_id”:5008949333,”selling_plan_group_id”:”44d12b8db8104584d7d07c5390f6a8a2e82f9b59″},{“price_adjustments”:[{“position”:1,”price”:66495}],”value”:66495,”compare_at_price”:69995,”per_delivery_price”:66495,”selling_plan_id”:5009408085,”selling_plan_group_id”:”44d12b8db8104584d7d07c5390f6a8a2e82f9b59″}],”quantity_rule”:{“min”:1,”max”:null,”increment”:1}};edgetag(‘tag’, ‘ViewContent’, {forex: getLocalCurrency(),worth: present.value / 100,contents: [{id: ‘2693988057173’,variantId: current.id.toString(),sku: current.sku,quantity: 1,item_price: current.price / 100,title: current.name,category: ‘3 Month Emergency Food Supplies’,brand: ‘4Patriots’,image: ‘https://4patriots.com/cdn/shop/files/ARRAY-3MO-72HRx2-WB.png?v=1699626278’,url: ‘https://4patriots.com/products/3-month-survival-food-kit?variant=40388560814165’,type: ‘product’,}],});window.addEventListener(‘load’, () => {doc.addEventListener(‘click on’, (e) => {checkElement(e.goal);});});if (window.location.pathname.startsWith(‘/search’) ||window.location.pathname.startsWith(‘/pages/search-results-page’)) {const searchParams = new URLSearchParams(window.location.search);const search = searchParams.get(‘q’);if (search) {edgetag(‘tag’, ‘Search’, { search });}}window.addEventListener(‘message’,(occasion) => {if (occasion.origin !== ‘https://creatives.attn.television’) {return;}if (!occasion.knowledge || !occasion.knowledge.__attentive) {return;}attempt {const knowledge = occasion.knowledge.__attentive;if (!knowledge.motion || !knowledge.motion.contains(‘LEAD’)) {return;}const person = {};if(knowledge.e-mail) {person.e-mail = knowledge.e-mail;}if(knowledge.telephone) {person.telephone = knowledge.telephone.substitute(/[^0-9]/g, ”);}sendUser(person);edgetag(‘tag’, ‘Subscribe’);} catch (e) {console.log(“[Edgetag]”, e);}},false);window.addEventListener(‘message’, (occasion) => {if(!occasion || !occasion.origin || !occasion.knowledge || !occasion.origin.contains(‘postscript’)) {return;}if (occasion.knowledge.hasOwnProperty(‘CollectedEmailEvent’) && occasion.knowledge.CollectedEmailEvent.e-mail) {sendUser({ e-mail: occasion.knowledge.CollectedEmailEvent.e-mail });edgetag(‘tag’, ‘Subscribe’);}});window.juapp = window.juapp||operate()[]).push(arguments);juapp(“trackFunc”, “engagement”, operate(e-mail, eventname, promotitle, cmid, choices, kind) {if (!e-mail) {return;}const userData = { e-mail };kind.forEach((merchandise) => {if (merchandise.identify === “phone_number” && merchandise.worth) {userData[“phone”] = merchandise.worth;}});edgetag(“knowledge”, userData);edgetag(“tag”, “Subscribe”);});}();]]> 3-Month Survival Meals Equipment | 4Patriots