<!DOCTYPE html>
<html>

<head>

<script>
    window.dataLayer = window.dataLayer || [];
</script>

<?php /*
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-539QQ9F');</script>
*/ ?>

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-NBSZ7ZX');</script>


<script>

    function testAddToCart() {
        dataLayer.push({ ecommerce: null });
        dataLayer.push({
            'event': 'addToCart',
            'ecommerce': {
                'currencyCode': 'EUR',
                'add': {
                    'products': [{
                        'name': 'Vyne Test Product',
                        'id': '444',
                        'price': '44.44',
                        'quantity': 1
                    }]
                }
            }
        });
    }


    function testList() {
        dataLayer.push({ ecommerce: null });
        dataLayer.push({
            'event': 'productView',
            'ecommerce': {
                'detail': {
                    'actionField': {'list': 'Vyne Products'},
                    'products': [{
                        'name': 'Vyne Test Product',
                        'id': '444',
                        'price': '44.44'
                    }]
                }
            }
        });
    }


    function testCheckout(step) {
        dataLayer.push({ ecommerce: null });
        dataLayer.push({
            'event': 'checkout',
            'ecommerce': {
                'checkout': {
                    'actionField': {'step': step, 'option': 'mtc. test'},
                    'products': [{
                        'name': 'Vyne Test Product',
                        'id': '444',
                        'price': '44.44',
                        'quantity': 1
                    }]
                }
            },
            'eventCallback': function() {
                //document.location = 'checkout.html';
            }
        });
    }


    function testPurchase() {

        dataLayer.push({ ecommerce: null });
        dataLayer.push({
          'event': 'purchaseConfirmed',
          'ecommerce': {
            'purchase': {
              'actionField': {
                'id': 'Vyne_TEST_123',
                'revenue': '44.44'
              },
              'products': [{
                'name': 'Vyne Test Product',
                'id': '444'
               }]
            }
          }
        });
    }


</script>


</head>


<body>

<button onclick="testList()">list</button>
<button onclick="testAddToCart()">addToCart</button>
<button onclick="testCheckout(1)">checkout(step=1)</button>
<button onclick="testCheckout(2)">checkout(step=2)</button>
<button onclick="testCheckout(3)">checkout(step=3)</button>
<button onclick="testPurchase()">purchase</button>



</body>

