Last active
February 18, 2025 13:10
-
-
Save mariusbolik/aa02177f4c95ccdf8b65de562146af73 to your computer and use it in GitHub Desktop.
Revisions
-
mariusbolik revised this gist
Feb 18, 2025 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,11 +8,11 @@ if (event.type === 'RESULT') { // Work with the result - e.g. preselect size in shop if (typeof hj === 'function' && 'result' in event.data) { const hjRes = hj('event', 'myshoefitter_result', { size: event.data.result, product: document.title }); console.log('mySHOEFITTER button click event sent to Hotjar:', hjRes); } else { console.error('hj function is not defined.'); } @@ -22,10 +22,11 @@ if (event.type === 'BUTTON' && event.data && event.data.action === 'click') { // Send click event to google tag manager if (typeof hj === 'function') { const hjClick = hj('event', 'myshoefitter_button_click', { size: event.data.result, product: document.title }); console.log('mySHOEFITTER button click event sent to Hotjar:', hjClick); } else { console.error('hj function is not defined.'); } -
mariusbolik revised this gist
Feb 18, 2025 . 1 changed file with 15 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,19 +7,30 @@ console.log('mySHOEFITTER Event', event); if (event.type === 'RESULT') { // Work with the result - e.g. preselect size in shop if (typeof hj === 'function' && 'result' in event.data) { hj('event', 'myshoefitter_result', { size: event.data.result, product: document.title }); console.log('mySHOEFITTER button click event sent to Hotjar.'); } else { console.error('hj function is not defined.'); } console.log('mySHOEFITTER Shoe Size', event.data.result); } if (event.type === 'BUTTON' && event.data && event.data.action === 'click') { // Send click event to google tag manager if (typeof hj === 'function') { hj('event', 'myshoefitter_button_click', { product: document.title }); console.log('mySHOEFITTER button click event sent to Hotjar.'); } else { console.error('hj function is not defined.'); } // Log the event to the console (for debugging purposes) console.log('Shopify button click event sent to Hotjar.'); } }); myshoefitter.init({ -
mariusbolik revised this gist
Feb 18, 2025 . 1 changed file with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,12 +12,8 @@ if (event.type === 'BUTTON' && event.data && event.data.action === 'click') { // Send click event to google tag manager if (typeof hj === 'function') { hj('event', 'myshoefitter_button_click'); console.log('mySHOEFITTER button click event sent to Google Analytics.'); } else { console.error('gtag function is not defined.'); -
mariusbolik revised this gist
Feb 17, 2025 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,9 +29,12 @@ myshoefitter.init({ shopSystem: 'shopify', button: { attachTo: ".product-form__input--dropdown", position: "after", // before text: "Find your size", styles: { border: "2px solid var(--primary_button_background_gradient)", } } }); </script> -
mariusbolik revised this gist
Feb 17, 2025 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,29 @@ <!-- Initialize mySHOEFITTER --> <script type="application/javascript"> myshoefitter.events(event => { console.log('mySHOEFITTER Event', event); if (event.type === 'RESULT') { // Work with the result - e.g. preselect size in shop console.log('mySHOEFITTER Shoe Size', event.data.result); } if (event.type === 'BUTTON' && event.data && event.data.action === 'click') { // Send click event to google tag manager if (typeof gtag === 'function') { gtag('event', 'click', { event_category: 'mySHOEFITTER', // Group or category for the event event_label: 'mySHOEFITTER Button', // Label to identify the event value: 1 // Optional numeric value associated with the event }); console.log('mySHOEFITTER button click event sent to Google Analytics.'); } else { console.error('gtag function is not defined.'); } // Log the event to the console (for debugging purposes) console.log('Shopify button click event sent to Google Analytics.'); } }); myshoefitter.init({ shopSystem: 'shopify', button: { -
mariusbolik created this gist
Nov 7, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <!-- Load the mySHOEFITTER Script --> <script src="https://js.myshoefitter.com/v1/script.js"></script> <!-- Initialize mySHOEFITTER --> <script type="application/javascript"> myshoefitter.init({ shopSystem: 'shopify', button: { styles: { border: '2px solid var(--secondary_button_background_gradient)', } } }); </script>