jquery for google eCommerce
#Use
-
If you already have a code implemented. Exclude the following lines:
ga('require', 'ec'); ga('send', 'pageview');
-
After include a version of jquery in your code before this plugin. As this:
<body> ... <script src="http://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="<your_public_path_to_plugins>/jquery.google.ecommerce.js"></script> </body>
-
So, put jquery.google.ecommerce.js in your your_public_path_to_plugins.
#Optional When you want send a specific route to pageview search this code
ga('create', 'UA-6########-#', 'auto');
and include this variable after with your route
dataECPageView = "route_to_my_product_list;
as example
...
ga('create', 'UA-########-#', 'auto');
dataECPageView = window.location.pathname;