<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>ProductCart Shopping Cart Software Forums : Analytics enhanced ecommerce events w/ angular</title>
  <link>https://forum.productcart.com/</link>
  <description><![CDATA[This is an XML content feed of; ProductCart Shopping Cart Software Forums : Using ProductCart : Analytics enhanced ecommerce events w/ angular]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 10 Apr 2026 17:13:35 +0000</pubDate>
  <lastBuildDate>Sun, 28 May 2017 23:48:53 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forum.productcart.com/RSS_post_feed.asp?TID=6110</WebWizForums:feedURL>
  <image>
   <title><![CDATA[ProductCart Shopping Cart Software Forums]]></title>
   <url>https://forum.productcart.com/forum_images/pc_logo_50.png</url>
   <link>https://forum.productcart.com/</link>
  </image>
  <item>
   <title><![CDATA[Analytics enhanced ecommerce events w/ angular : I&amp;#039;m trying to add enhanced...]]></title>
   <link>https://forum.productcart.com/analytics-enhanced-ecommerce-events-w-angular_topic6110_post22768.html#22768</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forum.productcart.com/member_profile.asp?PF=1159">Brett</a><br /><strong>Subject:</strong> 6110<br /><strong>Posted:</strong> 28-May-2017 at 11:48pm<br /><br />I'm trying to add enhanced ecommerce tracking to my store. I managed to get it to track when products are viewed by including this on viewprd.asp:<br /><table width="99%"><tr><td><pre class="BBcode"><br />&lt;script&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;ga('ec:addProduct', {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'id': '&lt;%=pSku%&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'name': '&lt;%=pMainProductName%&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'brand': '&lt;%=BrandName%&gt;'<br />&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;ga('ec:setAction', 'detail');<br />&lt;/script&gt;<br /></pre></td></tr></table><br /><br />And then to track when an item is added to the cart, I added this at the end of the checkproqty() function from pcValidateViewPrd.asp:<br /><table width="99%"><tr><td><pre class="BBcode"><br />ga('ec:addProduct', {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id': '&lt;%=pSku%&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name': '&lt;%=pMainProductName%&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'brand': '&lt;%=BrandName%&gt;',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price': &lt;%=pPrice%&gt;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'quantity': fname.value<br />});<br />ga('ec:setAction', 'add');<br />ga('send', 'event', 'UX', 'click', 'add to cart');<br /></pre></td></tr></table><br />Now I'm trying to get it to track when an item is removed from the cart. However, on the viewcart.asp page all of the cart data is handled by angular.js.<br /><br />I'm not sure how to reference the cart variables. For the previous two events, I'm having it output the actual variables from ASP into the script. For this one, it's seeming like I'm going to need to have it reference the angular.js cart object and then the specific item from the cart.<br /><br />I figure it would probably look something like this:<br /><table width="99%"><tr><td><pre class="BBcode"><br />function removeCartItem({{shoppingcartitem}}) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ga('ec:addProduct', {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id': '{{shoppingcartitem.sku}}',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name': '{{shoppingcartitem.description}}',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price': {{shoppingcartitem.UnitPrice}},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'quantity': {{shoppingcartitem.quantity}}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ga('ec:setAction', 'remove');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ga('send', 'event', 'UX', 'click', 'remove from cart');<br />}<br /></pre></td></tr></table><br />Any chance anyone knows a good way to accomplish this?]]>
   </description>
   <pubDate>Sun, 28 May 2017 23:48:53 +0000</pubDate>
   <guid isPermaLink="true">https://forum.productcart.com/analytics-enhanced-ecommerce-events-w-angular_topic6110_post22768.html#22768</guid>
  </item> 
 </channel>
</rss>