jwinkel Posted October 15, 2014 Report Share Posted October 15, 2014 Wie bekomme ich es hin, dass ein im Produkt-Template eingefügter Java-Code erneut ausgeführt wird, wenn ein Kunde auf der Master-Seite eine Option auswählt (z.B. Farbe -> Grün)? Link to comment Share on other sites More sharing options...
Alex@4tfm Posted October 15, 2014 Report Share Posted October 15, 2014 das geht nicht ohne weiteres, siehe z.B.: http://archiv.raid-rush.ws/t-504485.html In dem Shop-Umfeld wäre es vielleicht sinnvoller das Script aus dem Content zu entfernen und gesondert einzubinden. Link to comment Share on other sites More sharing options...
jwinkel Posted October 15, 2014 Author Report Share Posted October 15, 2014 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.