Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

ParadiseTechsoft

Member
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi I am using squarespace for ecommerce. I already added google analytics to my website but want to add google analytics enhanced ecommerce plugin. Can you please tell me how to configurre enhanced eCommerce with squarespace.Here You can see I've tried adding enhanced ecommerce by following instructions on blog but I am unable to find correct data in google analytics report.Please have a look to my script in Code Injection-> "ORDER CONFIRMATION PAGE" (before this I have added Google analytics tracking code in(Setting->Advanced->External API Keys) See attached Enhanced ecommerce report: <script> ga('create', 'UA-105393502-1', 'auto'); ga('require', 'ec'); ga('send', 'pageview'); ga('ec:addImpression', { // Provide product details in an impressionFieldObject. 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '{ProductCategory}', // Product category (string). 'brand': '{ProductBrand}', // Product brand (string). 'variant': '{variant}', // Product variant (string). 'list': '', // Product list (string). 'dimension1': '' // Custom dimension (string). }); ga('ec:addProduct', { // Provide product details in a productFieldObject. 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '{ProductCategory}', // Product category (string). 'brand': '{ProductBrand}', // Product brand (string). 'variant': '{variant}', // Product variant (string). 'list': '', // Product list (string). 'dimension1': '' // Custom dimension (string). }); ga('ec:setAction', 'click', { // click action. 'list': 'Search Results' // Product list (string). ga('send', 'pageview'); }); // The impression from a Related Products section. ga('ec:addImpression', { // Provide product details in an impressionFieldObject. 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '{ProductCategory}', // Product category (string). 'brand': '{ProductBrand}', // Product brand (string). 'variant': '{variant}', // Product variant (string). 'list': '', // Product list (string). 'dimension1': '' // Custom dimension (string). }); ga('ec:addProduct', { // Provide product details in an productFieldObject. 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '', // Product category (string). 'brand': '', // Product brand (string). 'variant': '', // Product variant (string). 'price': '', // Product price (number). 'coupon': '', // Product coupon (string). 'quantity': 1 // Product quantity (number). }); ga('ec:setAction', 'purchase', { // Transaction details are provided in an actionFieldObject. 'id': '{orderId}', // (Required) Transaction id (string). 'affiliation': '', // Affiliation (string). 'revenue': '', // Revenue (number). 'tax': '', // Tax (number). 'shipping': '', // Shipping (number). 'coupon': '' // Transaction coupon (string). });// Refund an entire transaction. ga('ec:setAction', 'refund', { 'id': '{orderId}',// Transaction ID is only required field for full refund. }); // 1. Send product and impression data with pageview. ga('ec:addProduct', { 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '', // Product category (string). 'brand': '', // Product brand (string). 'variant': '', // Product variant (string). }); // The impression from the Related Products section. ga('ec:addImpression', { 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': ' ' // Product category (string). 'brand': '', // Product brand (string). 'variant': '', // Product variant (string). 'list': '', // Product list (string). }); ga('ec:setAction', 'detail'); // Detail action. ga('send', 'pageview'); // Send the product data with initial pageview. // 2. Send the promo click data when the promo click occurs. // Call this function when promo click occurs. function onPromoClick() { ga('ec:addPromo', { 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'creative': '', 'position': '' }); // Send the promo_click action with an event. ga('ec:setAction', 'promo_click'); ga('send', 'event', '', 'click', ''); }// Called when a link to a product is clicked. function onProductClick() { ga('ec:addProduct', { 'id': '{orderId}', // Product ID (string). 'name': '{ProductName}', // Product name (string). 'category': '', 'brand': '', 'variant': '', }); ga('ec:setAction', 'click', {list: 'Search Results'}); // Send click with an event, then send user to product page. ga('send', 'event', 'UX', 'click', 'Results', { hitCallback: function() { document.location = '/product_details?id=P12345'; } }); } // Called when a product is added to a shopping cart. function addToCart(product) { 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', 'add'); ga('send', 'event', 'UX', 'click', 'add to cart'); // Send data using an event. }
×
×
  • Create New...