Jump to content
xt:Commerce Community Forum

Javascript und Master-Slave Ajax-Mode?


jwinkel

Recommended Posts

Hast Du einen Vorschlag, wie das gehen könnte - es dreht sich um Google Universal Analytics, der einzubindende Code ist:

{if $products_master_model != ''}

    {literal}

    < script>

    dataLayer.push({

      'ecommerce': {

        'detail': {

          'actionField': {'list': '{/literal}{$products_master_model}{literal}'},

          'products': [{

           'name': '{/literal}{$products_name}{literal}',

           'id': '{/literal}{$products_model}{literal}',

           'price': '{/literal}{$products_price.plain|string_format:"%.2f"}{literal}',

           'brand': '{/literal}{$manufacturers_name|escape:"html"}{literal}',

           'category': '{/literal}{$google_product_cat}{literal}',

           'variant': '{/literal}{if $products_master_model != ""}{$products_short_name|escape:"html"|strip}{/if}{literal}'

           }]

         }

       }

    });

    </ script>

    {/literal}

{else}

    {literal}

    < script>

    dataLayer.push({

      'ecommerce': {

        'currencyCode': 'EUR',

        'impressions': [

         {

           'name': '{/literal}{$products_name}{literal}',

           'id': '{/literal}{$products_model}{literal}',

           'price': '{/literal}{$products_price.plain|string_format:"%.2f"}{literal}',

           'brand': '{/literal}{$manufacturers_name|escape:"html"}{literal}',

           'category': '{/literal}{$google_product_cat}{literal}',

           'variant': '{/literal}{if $products_master_model != ""}{$products_short_name|escape:"html"|strip}{/if}{literal}',

            'list': '{/literal}{if $products_master_flag == "1"}{$products_model}{/if}{literal}',

           'position': 1

         }]

      }

    });

    </ script>

    {/literal}

{/if}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...