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 characters
| 活動事件: Impression | |
| 活動標籤: product: {{商品數量}} | |
| 活動事件: ProductClick | |
| 活動標籤: {{商品名稱}} | |
| 活動事件: Detail | |
| 活動標籤: {{商品ID}} | |
| 活動事件: AddToCart |
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 characters
| <!-- 設定 GA path 包含 hash 資訊 --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=UA-66441042-10"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('config', 'UA-125318390-1', { | |
| 'page_path': window.location.pathname + window.location.hash | |
| }); | |
| </script> |
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 characters
| <script> | |
| var jQuery = jQuery || undefined; | |
| (function($) { | |
| var dataLayer = window.dataLayer || []; | |
| var eventCategoryString = '首頁'; | |
| eventFun($); | |
| function eventFun($) { |
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 characters
| var jQuery = jQuery || undefined; | |
| (function($) { | |
| tdFun($); | |
| function tdFun($) { | |
| if ($) { | |
| setEvent(); | |
| } else { | |
| // 載入jQ |
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 characters
| // 至少有一個字元 | |
| .+ | |
| // 判斷首頁 | |
| \/(index\.html)?$ | |
| // 符合 /a_myday/ 或 /a_myday/index.php | |
| ^\/a_myday/(index.php)?$ | |
| // 符合 / 或 /ecshop/ | |
| ^\/(ecshop\/?)?$ |
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 characters
| (function($) { | |
| var eventCategoryString = '會員註冊'; | |
| $('#email').on('change', function() { | |
| pushDatalayer('填寫資料 - E-mail', $(this).val()); | |
| }); | |
| $('#passwd1').on('change', function() { | |
| pushDatalayer('填寫資料 - 輸入密碼', '次數'); | |
| }); | |
| $('#passwd2').on('change', function() { |
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 characters
| (function($) { | |
| var dataLayer = window.dataLayer || []; | |
| var eventString = 'cusevent'; | |
| var eventCategoryString = '會員註冊'; | |
| $('#rg_button').click(function(e) { | |
| var eventInfo = [ | |
| ['填寫資料 - E-mail', $('#email').val()], | |
| ['填寫資料 - 輸入密碼', $('#passwd1').val()], | |
| ['填寫資料 - 輸入確認密碼', $('#passwd2').val()], |
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 characters
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
| <script> | |
| (function($) { | |
| var dataLayer = window.dataLayer || []; | |
| var eventString = 'cusevent'; | |
| var eventCategoryString = '2018淡季早鳥優惠'; | |
| var eventInfo = [ | |
| ['.pc-a-bt td:nth-child(1)', '服務按鈕點擊', '預約租車'], | |
| ['.pc-a-bt td:nth-child(2)', '服務按鈕點擊', '加入會員'], |
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 characters
| function scrollRatio(percentage) { | |
| var domHeight = Math.max( | |
| document.body.scrollHeight, | |
| document.body.offsetHeight, | |
| document.documentElement.clientHeight, | |
| document.documentElement.scrollHeight, | |
| document.documentElement.offsetHeight); | |
| return parseInt(window.scrollY / (domHeight - window.innerHeight) * 100 / percentage) * percentage || 0; | |
| } |