Home | Kavarna Cafe & Roastery

Posted by:

Category:

Comments:

Post Date:


Home | Kavarna Cafe & Roastery

[] Home | Kavarna Cafe & Roastery { conversionClient.emitEvent('pageview', {}, pageViewEventId); }); } document.addEventListener('viewproduct', window.fbq_viewproduct); document.addEventListener('addtocart', window.fbq_addtocart); document.addEventListener('purchase', window.fbq_makepurchase); document.addEventListener('pageview', window.fbq_pageview); function getCookie(doc,name) { var decodedCookie = decodeURIComponent(doc.cookie); var cookies = decodedCookie.split(';'); var cookieName = name + '='; for (let i = 0; i { if (this.capiEnabled) { try { const fbp = getCookie(document, '_fbp'); const fbc = getCookie(document, '_fbc'); const serverPayload = {...payload}; if (fbp) { serverPayload['fbp'] = fbp; } if (fbc) { serverPayload['fbc'] = fbc; } serverPayload.event_id = eventId; const body = { eventName: eventName, payload: serverPayload, }; const endpoint = '/app/cms/api/v1/sites/79d85720-0336-11eb-8e67-7d3d23dcc712/facebook/pixel-events'; const csrfToken = getCookie(document, window.XSRF_COOKIE_NAME); const response = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-XSRF-TOKEN': csrfToken }, body: JSON.stringify(body) }) } catch (err) { console.warn('Error sending to facebook', err); } } } } window.conversionClient = new FBConversionClient(); })(); ]]> { const loadingElement = document.querySelector('.loading-view'); if (loadingElement) { loadingElement.remove(); } }; ]]> Source

Share this post

Leave a Reply

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


Related

Posts