Bài viết này là kết hợp với bài viết Hướng dẫn Enhanced Ecommerce trong Google Analytics dành cho người mới bắt đầu, đã giới thiệu những khái niệm, lợi ích và sự khác biệt giữa enhanced ecommerce và ecommerce truyền thống.
Trong bài này sẽ chia sẻ rất nhiều mã theo dõi. Mã theo dõi trên bài viết này là những ví dụ, khá giống với mã theo dõi thực tế trên website của bạn. Bạn không nên áp dụng những mã theo dõi này trên website của bạn. Bạn nên tùy chỉnh để phù hợp với sự hoạt động website, máy chủ của bạn.
Thực tế mã theo dõi enhanced ecommerce không khống như mã theo dõi ecommerce truyền thống, nó cần được triển khai kèm theo những đoạn script từ phía server của website.
Mục tiêu của bài viết này là cung cấp một nền tảng chung để bạn hoặc nhà phát triển web của bạn có thể triển khai enhanced ecommerce trên website của bạn.
Dưới đây là 11 hoạt động mua sắm quan trọng nhất
- Người dùng xem chiến dịch quảng cáo nội bộ (như banner nội bộ trên trang chủ).
- Người dùng nhấp vào chiến dịch quảng cáo nội bộ và sau đó chuyển đến trang danh sách sản phẩm (có thể là loại trang sản phẩm hoặc trang kết quả tìm kiếm nội bộ).
- Người dùng xem một sản phẩm trong danh sách sản phẩm.
- Người dùng nhấp vào một trong các liên kết sản phẩm trong danh sách sản phẩm để xem thêm chi tiết về sản phẩm.
- Người dùng sau đó xem trang chi tiết sản phẩm.
- Người dùng sau đó quyết định mua sản phẩm. Do đó họ thêm một hoặc nhiều sản phẩm vào giỏ hàng của mình.
- Người dùng sau đó có thể quyết định xóa một hoặc nhiều sản phẩm ra khỏi giỏ hàng trước khi bắt đầu quá trình thanh toán.
- Người dùng quyết định bắt đầu quá trình thanh toán và hoàn tất các bước khác nhau trong quy trình thanh toán.
- Người dùng cung cấp thông tin bổ sung trong quá trình thanh toán (như chọn phương thức thanh toán hoặc vận chuyển).
- Người dùng cuối cùng đã hoàn tất quy trình thanh toán bằng cách mua hàng.
- Người dùng có thể sau đó quyết định yêu cầu hoàn lại tiền của mình.
Trong thương mại điện tử nâng cao, chúng ta có thể theo dõi tất cả 11 hoạt động mua sắm này (và nhiều hơn nữa) để có được cái nhìn sâu rộng về hành vi mua sắm của người dùng.
1. Đo lường số lượt xem của chiến dịch quảng cáo nội bộ
Quảng cáo nội bộ hay còn gọi là internal promotion là những quảng cáo (như banner ads trên trang chủ) đưa người dùng đến những phần khác của website.
Ví dụ bạn có thể chay quảng cáo biểu ngữ trên trang chủ, quảng bá danh mục sản phẩm cụ thể và khi người dùng nhấp vào biểu ngữ sẽ được chuyển đến trang danh mục sản phẩm.
Lượt xem quảng cáo nội bộ hay còn được gọi là internal promotion impression.
Do đó, nếu người dùng xem quảng cáo nội bộ 2 lần thì internal promotion impression là 2.
Dưới đây là ví dụ về mã theo dõi đo lường internal ad impression:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); ga('ec:addPromo',{ // promoFieldObject stores internal promotion impression data 'id': '[Server Variable]', // internal ad ID - Required – Type: string - Example: 'homeBanner1' 'name': '[Server Variable]', // internal promotion campaign Name - Type: string - Example: 'Spring sale' 'creative': '[Server Variable]', // internal ad name - Type: String - Example: 'Spring Sale banner1' 'position': '[Server Variable]' // Position of the internal ad - Type: string - Example: 'home top banner' }); ga('send', 'pageview'); </script> |
Mã theo dõi này được đặt trên trang web nơi bạn đang chạy quảng cáo nội bộ và bạn muốn đo lượt hiển thị.
Ở đây:
ga(‘require’, ‘ec’); là một lệnh Google Analytics được sử dụng để tải plugin enhanced ecommerce. Nếu không có plugin này thì mã theo dõi enhanced ecommerce sẽ không hoạt động.
ga(‘ec:addPromo’,promoFieldObject); là lệnh enhanced ecommerce được cải tiến được sử dụng để thu thập và lưu trữ dữ liệu hiển thị của chiến dịch quảng cáo nội bộ. Lệnh này được tạo thành bởi
– ec:addPromo đó là lệnh của Google Analytics được sử dụng để đo lường số lần hiển thị quảng cáo nội bộ và gửi dữ liệu hiển thị tới promoFieldObject.
– promoFieldObject là một đối tượng JavaScript được sử dụng để lưu dữ liệu hiển thị của các chiến dịch quảng cáo nội bộ:
1 2 3 4 5 6 7 |
{ // promoFieldObject stores internal promotion impression data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ } |
Sau đây là các thuộc tính khác nhau của promoFieldObject:
- id
- name
- creative
- position
[Server Variable] – đây là các biến của server. Bạn cần yêu cầu nhà phát triển của mình viết một script chứa các trường khác nhau của server (server variables) cho mã theo dõi ở trên, với dữ liệu thực tế.
Lưu ý: sử dụng thuộc tính ID GA của bạn (thay vì ‘UA-XXXX-YY’) cho mã theo dõi ở trên.
Bây giờ mình sẽ giải thích chi tiết các thành phần khác nhau của mã theo dõi được sử dụng để đo lường số lần hiển thị của chiến dịch quảng cáo nội bộ.
Giới thiệu về hit và hit type
Trong ngữ cảnh của Google Analytics, một hit là một tương tác của người dùng với trang web hoặc ứng dụng trên di động. Dữ liệu đó được gửi đến Google Analytics Web Property còn được gọi là hit.
Loại dữ liệu được gửi đến Google Analytics Web Property còn được gọi là hit type. Ví dụ như, ‘pageview’, ‘event’, ‘transactions’, ‘item’ v.v. tất cả đều là hit type.
Giới thiệu về tracker
Tracking object (hay còn được gọi là tracker) được sử dụng để gửi dữ liệu truy cập đến Google Analytics Web Property.
Nếu không tạo và sử dụng tracking object đầu tiên thì bạn không thể gửi dữ liệu hit đến Google Analytics Web Property.
Lệnh “create” trong Google Analytics được sử dụng để tạo một tracking object và liên kết tracking object với thuộc tính web.
Ví dụ như dòng mã sau đây tạo một đối tượng theo dõi mặc định.
1 |
ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); |
Bạn có thể xem dòng mã này trong đoạn code Google Analytics của mình.
Giới thiệu về Plugin Enhanced Ecommerce
Để thực hiện theo dõi enhanced ecommerce trên website của bạn, thì bạn cần phải sử dụng plugin enhanced ecommerce (còn được gọi tắt là “ec”).
Lệnh GA được sử dụng để tải plugin thương mại điện tử nâng cao là:
1 |
ga(‘require’, ‘ec’); // load enhanced ecommerce library |
Lệnh này tương tự như lệnh được sử dụng để tải plugin thương mại điện tử truyền thống trong Google Analytics:
1 |
ga(‘require’, ‘ecommerce’); // load traditional ecommerce library |
Cách sử dụng Plugin Enhanced Ecommerce
Cũng giống như plugin thương mại điện tử truyền thống, plugin thương mại điện tử nâng cao cũng phải được tải, sau tracking object và trước khi bạn sử dụng bất kỳ lệnh theo dõi thương mại điện tử nâng cao nào (ví dụ như: ec: addProduct).
Ví dụ như:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘require’, ‘ec’); // load enhanced ecommerce plugin ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion impression data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); ga(‘send’, ‘pageview’); </script> |
Nếu bạn tải plugin enhanced ecommerce trước tracking object, thì mã theo dõi enhanced ecommerce sẽ không hoạt động.
Ví dụ như đoạn mã theo dõi enhanced commerce sau sẽ không đo lường được số lần hiển thị của chiến dịch quảng cáo nội bộ.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘require’, ‘ec’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion impression data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); ga(‘send’, ‘pageview’); </script> |
Gửi dữ liệu enhanced ecommerce cùng với hit
Bạn có thể gửi dữ liệu ecommerce / enhanced ecommerce chỉ cùng với một hit (pageview, event v.v.).
Do đó, nếu bạn sử dụng lệnh enhanced ecommerce nhưng không gửi bất kỳ hit nào thì dữ liệu ecommerce của bạn sẽ không được gửi đến Google Analytics.
Ví dụ như mã theo dõi sau sẽ không gửi dữ liệu quảng cáo nội bộ đến GA (như mã ga(‘send’, ‘pageview’); bị thiếu):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘require’, ‘ec’); ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); << code to send the hit data is missing >> </script> |
Mã theo dõi chính xác là:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘require’, ‘ec’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); ga(‘send’, ‘pageview’); </script> |
Sử dụng lệnh enhanced ecommerce trước khi gửi hit
Nếu bạn sử dụng lệnh enhanced ecommerce sau khi hit được gửi thì dữ liệu ecommerce cũng sẽ không được chuyển đến Google Analytics.
Ví dụ như mã theo dõi sau sẽ không gửi dữ liệu hiển thị của quảng cáo nội bộ đến Google Analytics:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘require’, ‘ec’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘send’, ‘pageview’); ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion impression data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); </script> |
Mã theo dõi chính xác là:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘require’, ‘ec’); ga(‘create’, ‘UA-XXXXX-YY’, ‘auto’); ga(‘ec:addPromo’,{ // promoFieldObject stores internal promotion impression data ‘id’: ‘[Server Variable]’, // internal ad ID – Required – Type: string – Example: ‘homeBanner1’ ‘name’: ‘[Server Variable]’, // internal promotion campaign Name – Type: string – Example: ‘Spring sale’ ‘creative’: ‘[Server Variable]’, // internal ad name – Type: String – Example: ‘Spring Sale banner1’ ‘position’: ‘[Server Variable]’ // Position of the internal ad – Type: string – Example: ‘home top banner’ }); ga(‘send’, ‘pageview’); </script> |
Mình đề cập chi tiết như vậy hy vọng sẽ hữu ích cho bạn, đặt biệt là đối với những bạn đang thử nghiệm triển khai enhanced ecomemerce của mình.
Nếu như bạn không thấy dữ liệu trong báo cáo enhanced ecommerce trong GA của bạn thì hãy đảm bảo rằng bạn sẽ không mắc sai lầm về mã theo dõi enhanced ecommerce mà bạn gắn trên website của mình.
2. Đo lường click trên chiến dịch Quảng cáo nội bộ
Trong quá trình mua hàng, người dùng có thể nhấp vào những chiến dịch quảng cáo nội bộ trên website.
Sử dụng JavaScript Event Handler onClick để đo lường những nhấp chuột vào chiến dịch quảng cáo nội bộ (như banner):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// Call this function when promo click occurs. function onPromoClick() { ga('ec:addPromo', { // promoFieldObject stores internal promotion impression data 'id': '[Server Variable]', // internal ad ID - Required – Type: string - Example: 'homeBanner1' 'name': '[Server Variable]', // internal promotion campaign Name - Type: string - Example: 'Spring sale' 'creative': '[Server Variable]', // internal ad name - Type: String - Example: 'Spring Sale banner1' 'position': '[Server Variable]' // Position of the internal ad - Type: string - Example: 'home top banner' }); // Send the promo_click action with an event. ga('ec:setAction', 'promo_click'); ga('send', 'event', 'enhanced ecommerce', 'Internal Promotion Click', '[INTERNAL PROMOTION NAME]'); } |
Mã theo dõi này được đặt trên trang web chỗ mà bạn đang chạy quảng cáo nội bộ và muốn đo lường những nhấp chuột.
Ở đây:
ga(‘ec:setAction’, <action-type>,actionFieldObject); – Lệnh enhanced ecommerce được sử dụng để thu thập và lưu trữ dữ liệu liên quan đến những hành động enhanced ecommerce. Lệnh này được tạo thành:
- ec:setAction – đây là lệnh của Google Analytics được sử dụng để đo lường những dữ liệu hoạt động của thương mại điện tử và sau đó gửi dữ liệu đến actionFieldObject.
- <action-type> – biểu thị những hành động ecommerce của người dùng.
1. ‘promo_click’: ví dụ như ga(‘ec:setAction’, ‘promo_click’); // đo lường nhấp chuột lên quảng cáo nội bộ
2. ‘detail’: ví dụ như ga(‘ec:setAction’, ‘detail’); // xem chi tiết sản phẩm
3. ‘add’: ví dụ như ga(‘ec:setAction’, ‘add’); // đo lường sản phẩm thêm vào giỏ hàng
4. ‘remove’: ví dụ như ga(‘ec:setAction’, ‘remove’); // đo lường xóa sản phẩm khỏi giỏ hàng
5. ‘checkout‘: ví dụ như ga(‘ec:setAction’,’checkout’, {‘option’: ‘visa’}); // đo thêm thông tin về bước thanh toán
6. ‘purchase’: ví dụ như ga(‘ec:setAction’, ‘purchase’,{…}); // đo lường mua hàng
7. ‘refund’: ví dụ như ga(‘ec:setAction’, ‘promo_click’); // đo lường hoàn tiền lại của một hoặc nhiều sản phẩm. - actionFieldObject – nó là một đối tượng JavaScript được sử dụng để lưu trữ dữ liệu hành động ecommerce. Ví dụ đối tượng này có thể là những loại sau:
1 2 3 4 5 6 7 8 9 10 11 12 |
{ // actionFieldObject stores action data ‘id’: ‘VBT145346’, // Transaction id – Type: string ‘affiliation’: ‘VB Store’, // Store name – Type: string ‘revenue’: ‘37.39’, // Total Revenue – Type: numeric ‘tax’: ‘2.85’, // Tax – Type: numeric ‘shipping’: ‘5.34’, // Shipping – Type: numeric ‘coupon’: ‘SUMMER2018’ // Order/Transaction coupon – Type: string ‘list’: ‘Danh muc Ao Thun’, // Product list – Type: string ‘step’: 1, // Number representing a step in the checkout process – Type: numeric ‘option’: ‘paypal’, // Used to provide additional info about a checkout step like payment method used- Type: string }; |
Sau đây là các thuộc tính của actionFieldObject:
- id
- affiliation
- revenue
- tax
- shipping
- coupon
- list
- step
- option
‘onPromoClick’ có thể ràng buộc với JavaScript event handler ‘onClick’ như sau:
1 |
<a href=”/tops/” onClick=”onPromoClick();”><img src=”/prod/summersalepromo.jpg”></a> |
Bạn yêu cầu developer viết một script chứa các trường khác nhau (các biến sever) của mã theo dõi của bạn với những dữ liệu thực tế.
Lưu ý: Không gửi dữ liệu hiển thị quảng cáo nội bộ cùng với dữ liệu click vào quảng cáo nội bộ chỉ cùng với một hit. Cần phải gửi 2 loại dữ liệu này tách biệt nhau.
Mã theo dõi hoàn chỉnh có thể tương tự như sau:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Call this function when promo click occurs. function onPromoClick() { ga('ec:addPromo', { // promoFieldObject stores internal promotion impression data 'id': '[Server Variable]', // internal ad ID - Required – Type: string - Example: 'homeBanner1' 'name': '[Server Variable]', // internal promotion campaign Name - Type: string - Example: 'Spring sale' 'creative': '[Server Variable]', // internal ad name - Type: String - Example: 'Spring Sale banner1' 'position': '[Server Variable]' // Position of the internal ad - Type: string - Example: 'home top banner' }); // Send the promo_click action with an event. ga('ec:setAction', 'promo_click'); ga('send', 'event', 'enhanced ecommerce', 'Internal Promotion Click', '[INTERNAL PROMOTION NAME]'); } ga('send', 'pageview'); </script> |
3. Đo lường số lượt xem sản phẩm
Trong quá trình mua hàng, người dùng có thể xem sản phẩm trong danh sách sản phẩm (trang danh mục sản phẩm hoặc trang kết quả tìm kiếm).
Số lượt xem sản phẩm trong một danh sách sản phẩm được gọi là product impression (số lần hiển thị của sản phẩm)
Dưới đây là ví dụ về mã theo dõi để đo lường product impression được gắn trên trang danh sách sản phẩm:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); ga('ec:addImpression',{ // ImpressionFieldObject stores product impression data 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Name of the Product category. // Use / as a delimiter to specify up to 5 levels of hierarchy (e.g Men/Shirts/T-Shirts) - Type: string 'brand': '[Server Variable]',// Name of Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like: color, size etc - Type:string 'list': '[Server Variable]', // Name of the Product list like 'search results' - Type: string 'position': [Server Variable] // Product position in a list. For example 2 - Type: numeric }); ga('ec:addImpression',{ // ImpressionFieldObject stores product impression data 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Name of the Product category. // Use / as a delimiter to specify up to 5 levels of hierarchy (e.g Men/Shirts/T-Shirts) - Type: string 'brand': '[Server Variable]',// Name of Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like: color, size etc - Type:string 'list': '[Server Variable]', // Name of the Product list like 'search results' - Type: string 'position': [Server Variable] // Product position in a list. For example 2 - Type: numeric }); ga('send', 'pageview'); </script> |
Ở đây,
ga(‘ec:addImpression’,impressionFieldObject); là lệnh enhanced ecommerce được sử dụng để thu thập và lưu trữ dữ liệu hiển thị của sản phẩm. Lệnh này được tạo thành:
- ec:addImpression – đây là lệnh GA thu thập / đo lường số lần hiển thị sản phẩm và gửi dữ liệu đến impressionFieldObject.
- impressionFieldObject – đây là một JavaScript Object được sử dụng để lưu trữ product impression.
Lưu ý: impressionFieldObject phải có tên hoặc id. Những trường khác là tùy chọn
Sau đây là các thuộc tính của impressionFieldObject:
- id
- name
- category
- brand
- variant
- list
- position
Lưu ý: bạn nên yêu cầu developer viết script từ phía máy chủ (như php) để lặp lại tất cả cả các sản phẩm trên một trang và gửi dữ liệu product impression cho từng sản phẩm. Nó sẽ tự động điền vào những trường khác nhau của mã theo dõi. Và sau khi tùy chỉnh lại thì mã theo dõi của bạn sẽ khác với mã theo dõi mẫu ở trên.
4. Đo lường click vào sản phẩm trong danh sách sản phẩm
Trong quá trình mua hàng, người dùng có thể nhấp vào sản phẩm trong danh sách sản phẩm, để xem chi tiết về sản phẩm.
Để đo lường phải thêm Javascript event handler ‘onClick’ vào các liên kết của tất cả các sản phẩm được liệt kê trên trang (như trang kết quả tìm kiếm sản phẩm hoặc trang danh mục sản phẩm).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
// Called when a link to a product is clicked. function onProductClick() { ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like: color, size etc - Type: string 'position': [Server Variable] // Product position in a list - Type: numeric Example: 10 }); ga('ec:setAction', 'click', {list: '[Server Variable]'}); // Send click with an event, then send user to product page. ga('send', 'event', 'enhanced ecommerce', 'Product clicks', [Product]}); } |
Ở đây,
ga(‘ec:addProduct’,productFieldObject); là lệnh enhanced ecommerce được sử dụng để thu thập và lưu trữ tất cả dữ liệu sản phẩm. Lệnh này được tạo thành bởi:
– ec: addProduct – đây là lệnh Google Analytics thu thập / đo lường tất cả dữ liệu sản phẩm (trừ dữ liệu hiển thị sản phẩm) và sau đó gửi dữ liệu sản phẩm đến productFieldObject.
– ProductFieldObject – nó là một JavaScript object được sử dụng để lưu trữ tất cả dữ liệu sản phẩm (trừ dữ liệu hiển thị sản phẩm). Dữ liệu của các loại sản phẩm sau đây được lưu trữ trong JavaScript object này:
- Các sản phẩm đơn lẻ được xem trong danh sách sản phẩm
- Sản phẩm có trang chi tiết đã được xem
- Sản phẩm được thêm vào giỏ hàng
- Sản phẩm đã được xóa khỏi giỏ hàng
- Sản phẩm ở các bước của quá trình thanh toán
- Sản phẩm được mua
- Sản phẩm được hoàn lại tiền
Sau đây là các thuộc tính của productFieldObject:
- id
- name
- category
- brand
- variant
- price
- quantity
- coupon
- position
ga(‘ec:setAction’, ‘click’, {list: ‘[LIST NAME]’}); – đây là lênh enhanced ecommerce được sử dụng để đo lường nhấp chuột lên liên kết sản phẩm trong danh sách sản phẩm.
Developer cần phải viết một đoạn script máy chủ để gửi dữ liệu click của bất kỳ sản phẩm nào trong danh sách sản phẩm. Script này sẽ tự động điền vào những trường khác nhau của mã theo dõi của bạn
Chức năng của ‘onProductClick’ có thể được gắn thông qua Javascript event handler ‘onClick’ giống như dưới đây:
1 |
<a href=”/tops/figber/” onClick=”onProductClick();”><img src=”/prod/figber.jpg”></a> |
Mã hoàn chỉnh có thể giống như dưới đây:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Called when a link to a product is clicked. function onProductClick() { ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like: color, size etc - Type: string 'position': [Server Variable] // Product position in a list - Type: numeric Example: 10 }); ga('ec:setAction', 'click', {list: '[Server Variable]'}); // Send click with an event, then send user to product page. ga('send', 'event', 'enhanced ecommerce', 'Product clicks', [Product]}); ga('send', 'pageview'); </script> |
5. Đo lường số lượt xem sản phẩm chi tiết
Trong quá trình mua hàng, người dùng có thể xem trang chi tiết sản phẩm. Bạn có thể thêm mã sau vào trên mỗi trang chi tiết sản phẩm:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like color, size etc - Type: string }); ga('ec:setAction', 'detail'); }); ga('send', 'pageview'); </script> |
Ở đây:
- ga(‘ec:addProduct’,productFieldObject); là lệnh enhanced ecommerce được sử dụng để thu thập và lưu trữ tất cả dữ liệu sản phẩm (trừ dữ liệu hiển thị sản phẩm.
- ga(‘ec:setAction’, ‘detail’); đây là lệnh enhanced ecommerce được sử dụng để đo lường số lần xem trang sản phẩm chi tiết.
Developer có thể viết một script phù hợp với website của bạn. Script này tự động điền thông tin vào những trường khác nhau của mã theo dõi.
6. Đo lường thêm sản phẩm vào giỏ hàng
Trong quá trình mua sắm, người dùng có thể quyết định mua một sản phẩm, vì vậy họ sẽ thêm sản phẩm vào giỏ hàng.
Bạn có thể thêm đoạn script sau vào nút thêm vào giỏ hàng trên trang sản phẩm chi tiết.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Called when a product is added to a shopping cart. function addToCart(product) { ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like color, size etc - Type: string 'price': [Server Variable], // Product price - Type: numeric 'quantity': [Server Variable], // Product quantity - Type: numeric }); ga('ec:setAction', 'add'); // measure product add to cart ga('send', 'event', 'enhanced ecommerce', 'button click', 'add to Cart'); // Send 'add to cart' using an event. } ga('send', 'pageview'); </script> |
Ở đây:
- ga(‘ec:setAction’, ‘add’); là lệnh enhanced ecommerce được sử dụng để để đo sản phẩm được thêm vào giỏ hàng.
Developer có thể viết một script phù hợp với website của bạn. Script này tự động điền thông tin vào những trường khác nhau của mã theo dõi.
7. Đo lường xóa sản phẩm khỏi giỏ hàng
Trong quá trình mua hàng, người dùng có thể quyết định không mua một sản phẩm, và xóa sản phẩm khỏi giỏ hàng.
Mã hoàn chỉnh có thể giống như dưới đây:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Called when a product is removed from a shopping cart. function removeFromCart(product) { ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like color, size etc - Type: string 'price': [Server Variable], // Product price - Type: numeric 'quantity': [Server Variable], // Product quantity - Type: numeric }); ga('ec:setAction', 'remove'); // measure product remove from cart ga('send', 'event', 'enhanced ecommerce', 'button click', 'remove from Cart'); // Send 'remove from cart' using an event. } ga('send', 'pageview'); </script> |
Ở đây:
- ga(‘ec:setAction’, ‘remove’); là lệnh enhanced ecommerce được sử dụng để đo lường sản phẩm bị loại bỏ khỏi giỏ hàng.
Developer có thể viết một script phù hợp với website của bạn. Script này tự động điền thông tin vào những trường khác nhau của mã theo dõi.
8. Đo lường bước thanh toán đầu tiên
Trong quá trình mua sắm, người dùng có thể quyết định thoanh toán, và hoàn tất các bước khác nhau trong quá trình này.
Để đo bước thanh toán đầu tiên, sử dụng lệnh ec:addProduct command cho sản phẩm được thêm vào giỏ hàng và lệnh ec:setAction. Đặt loại hành động là ‘checkout’ và ‘step field’ là số bước.
Mã hoàn chỉnh có thể giống như dưới đây:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); /** * Called when the user clicks on the 'checkout' button */ function checkout(cart) { for(var i = 0; i < cart.length; i++) { var product = cart[i]; ga('ec:addProduct', { 'id': product.id, 'name': product.name, 'category': product.category, 'brand': product.brand, 'variant': product.variant, 'price': product.price, 'quantity': product.qty }); } ga('ec:setAction','checkout', {'step': 1}); // the value of 1 indicates first checkout step. } ga('send', 'pageview'); </script> |
Ở đây,
ga(‘ec:setAction’,’checkout’, {‘step’: 1}); là lệnh enhanced ecommerce được sử dụng để đo bước thanh toán đầu tiên của quy trình thanh toán.
9. Đo lường bước thanh toán thứ hai và kế tiếp
Tương tự để đo lường bước thanh toán thứ 2 và sau đó, bạn có thể sử dụng use ga(‘ec:setAction’,’checkout’, {‘step’: 2});, Ví dụ như bước thứ 3 sẽ là: use ga(‘ec:setAction’,’checkout’, {‘step’: 3});
Mã hoàn chỉnh có thể giống như dưới đây:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); /** * Called when the user moves to the next checkout step */ function checkout(cart) { for(var i = 0; i < cart.length; i++) { var product = cart[i]; ga('ec:addProduct', { 'id': product.id, 'name': product.name, 'category': product.category, 'brand': product.brand, 'variant': product.variant, 'price': product.price, 'quantity': product.qty }); } ga('ec:setAction','checkout', {'step': [step number]}); } ga('send', 'pageview'); </script> |
Lưu ý, nếu quá trình thanh toán của bạn chỉ có 1 bước hoặc bạn không có ý định cấu hình cài đặt kênh thanh toán enhaneced ecommerce trong web property thì bạn không cần phải thực hiện những bước đo lường thanh toán này.
10. Đo lường các tùy chọn thanh toán
Sẽ rất hữu ích khi đo lường thêm các tùy chọn thanh toán như phương thức thanh toán.
Mã ví dụ:
1 2 3 4 5 6 7 8 |
// Called when user selects a payment option. function onPaymentSelection(stepNumber, optionSelected) { ga(‘ec:setAction’, ‘checkout_option’, { ‘step’: 2, ‘option’:’visa’ }); ga(‘send’, ‘event’, ‘enhanced ecommerce’, ‘checkout_option’, ‘visa’,2); } |
Mã hoàn chỉnh có thể giống như dưới đây:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Called when user provides additional information. function onAdditionalInformation(stepNumber, optionSelected) { ga('ec:setAction', 'checkout_option', { 'step': [stepNumber], 'option': [optionSelected] }); ga('send', 'event', 'enhanced ecommerce', 'checkout_option', [optionSelected],[stepNumber]); } ga('send', 'pageview'); </script> |
Lưu ý: Không phải mọi quá trình thanh toán đều cần tùy chọn thanh toán.
11. Đo lường mua hàng
Trong quá trình mua hàng, người dùng hoàn tất quá trình thanh toán bằng cách mua hàng.
Sử dụng mã theo dõi sau trên trang xác nhận thanh toán:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); ga('ec:addProduct',{ // productFieldObject stores product click and other details 'id': '[Server Variable]', // Product ID/SKU - Type: string 'name': '[Server Variable]', // Product name - Type: string 'category': '[Server Variable]', // Product category - Type: string 'brand': '[Server Variable]', // Product brand - Type: string 'variant': '[Server Variable]', // Variant of the product like color, size etc - Type: string ‘price’: [Server Variable], // Product price - Type: numeric ‘quantity’: [Server Variable], // Product quantity - Type: numeric }); // Transaction level information is provided via actionFieldObject. ga('ec:setAction', 'purchase',{ // actionFieldObject stores action data 'id': '[Server Variable]', // Transaction id - Type: string 'affiliation': '[Server Variable]', // Store name - Type: string 'revenue': '[Server Variable]', // Total Revenue - Type: numeric 'tax': '[Server Variable]', // Tax - Type: numeric 'shipping': '[Server Variable]', // Shipping - Type: numeric 'coupon': '[Server Variable]' // Order/Transaction coupon - Type: string }); ga('send', 'pageview'); </script> |
12. Đo lường hoàn tiền
Khi quá trình mua hàng kết thúc, người dùng có thể yêu cầu hoàn tiền lại. Bạn có thể cung cấp hoàn tiền lại toàn bộ hoặc một phần. Để đo lường tác động của hoàn tiền đối với hoạt động kinh doanh của bạn, bạn cần nhập dữ liệu hoàn tiền vào GA web property.
Bạn cũng có thể nhập dữ liệu hoàn tiền bằng tay bằng tính năng Nhập dữ liệu của Google Analytics thông qua API. Sau khi nhập lên hoàn tất thì bạn có thể xem dữ liệu trong báo cáo hiệu suất bán hàng của bạn.
Lưu ý, bạn không thể xóa hoặc sửa đổi dữ liệu sau khi sau khi tải lên GA. Do đó, bạn cần phải kiểm tra kỹ trước khi tải lên.
Và đoạn code hoàn chỉnh của hoàn tiền lại toàn bộ như sau:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Refund an entire transaction. ga('ec:setAction', 'refund', { 'id': '43545232' // Transaction id - Type: string - Required field }); ga('send', 'pageview'); </script> |
Và đoạn code hoàn chỉnh của hoàn tiền lại một phần như sau:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-YY', 'auto'); ga('require', 'ec'); // Refund a single product. ga('ec:addProduct', { 'id': 'PD3441', // // Product ID/SKU - Type: string - required field 'quantity': 1 // // Product quantity - Type: numeric - required field }); ga('ec:setAction', 'refund', { 'id': '43545232' // Transaction id - Type: string - Required field }); ga('send', 'pageview'); </script> |
Thực hiện theo dõi enhanced ecommerce trên website của bạn
Bước 1: Thêm yêu cầu enhanced ecommerce vào mã theo dõi
Thêm yêu cầu enhanced ecommerce vào mã theo dõi trên những trang của website bạn để theo dõi những hoạt động mua sắm quan trọng nhất.
Bước 2: Bật Enhanced ecommerce và đặt tên các bước thanh toán trong GA
Truy cập vào “Admin” Google Analytics của bạn, nhấp vào “Ecommerce Settings“, “Enable Ecommerce” và “Enhance Ecommerce Reporting“.
Đặt tên mô tả cho từng bước thanh toán của bạn:
Lưu ý: Nếu bạn không cấu hình tên các bước thanh toán thì bạn sẽ chỉ thấy một bước gọi là “Step 1” trong báo cáo Phân tích hành vi thanh toán. Nếu website của bạn chỉ có 1 bước thanh toán thì bạn không cần phải thực hiện bước này.
Một khi bạn đã bật “enhanced ecommerce reporting” thì bạn có thể xem báo cáo trong Conversions > Ecommerce trong GA của bạn.
Bước 3: Thay thế mã theo dõi thương mại điện tử cũ bằng mã theo dõi mua hàng của sản phẩm
Khi bạn đã thay thế mã theo dõi thương mại điện tử cũ bằng mã theo dõi mua hàng sản phẩm trên trang xác nhận đơn đặt hàng, theo dõi thương mại điện tử cũ sẽ được thay thế bằng theo dõi thương mại điện tử nâng cao.
Nếu bạn muốn an toàn, trước tiên hãy triển khai theo dõi thương mại điện tử nâng cao trên trang web thử nghiệm của bạn và cũng thông qua GA thử nghiệm. Bạn có thể cần phải sử dụng nhiều bộ theo dõi ở đây. Và khi mọi thứ ổn định và hoạt động đúng, thì sau đó triển khai mã theo dõi thương mại điện tử nâng cao trên trang web thực tế.
Bạn cũng có thể xem thêm những bài viết khác tại đây:
- Hướng dẫn Ecommerce Tracking trong Google Analytics dành cho người mới bắt đầu
- Hướng dẫn Enhanced Ecommerce trong Google Analytics dành cho người mới bắt đầu
- Điều chỉnh Bounce Rate thông qua Google Tag Manager
- 11 cách làm giảm Bounce Rate hiệu quả trong Google Analytics
- Hướng dẫn cài đặt Google Analytics tag thông qua Google Tag Manager