Jump to content
xt:Commerce Community Forum
Sign in to follow this  
jwinkel

Javascript und Master-Slave Ajax-Mode?

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}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...