Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions view/frontend/templates/hyva/script-pusher.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ declare(strict_types=1);
}

try {
// Add logic to store event
if ((eventData.event === 'trytagging_begin_checkout' || eventData.event === 'trytagging_view_cart') && eventData.marketing) {
const simpleHash = window.tagging_gtm_simple_hash(eventData);
const advancedHash = window.tagging_gtm_advanced_hash(eventData);
Expand All @@ -66,7 +65,6 @@ declare(strict_types=1);
window.tagging_gtm_save_hash(advancedHash, eventData.marketing);
}
} catch (error) {
// Ensure we don't break the event
console.error('Error generating hashes:', error);
}

Expand Down
5 changes: 0 additions & 5 deletions view/frontend/templates/iframe.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ window.tagging_gtm_simple_hash = function(eventData) {

const parts = [];

// Add items and quantities
eventData.ecommerce.items.forEach(item => {
const itemId = item.item_id || "";
const quantity = item.quantity || 0;
parts.push(`i_id=${itemId}&qt=${quantity}`);
});

// Join all parts and encode to base64
const value = parts.join("&");
return btoa(value);
}
Expand All @@ -66,19 +64,16 @@ window.tagging_gtm_advanced_hash = function(eventData) {

const parts = [];

// Add items and quantities
eventData.ecommerce.items.forEach(item => {
const itemId = item.item_id || "";
const quantity = item.quantity || 0;
parts.push(`i_id=${itemId}&qt=${quantity}`);
});

// Add user agent (normalized: lowercase, spaces removed)
const userAgent = navigator.userAgent || "";
const normalizedUserAgent = userAgent.toLowerCase().replace(/\s+/g, "");
parts.push(`--ua=${normalizedUserAgent}`);

// Join all parts and encode to base64
const value = parts.join("&");
return btoa(value);
}
Expand Down
Loading