<? if ($settings["google.tracking_id"]):?>
<!-- Google Analytics -->
<script>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

	ga('create', '<?=$settings['google.tracking_id']?>', 'auto', 'adc');
//	
	ga(function (){
		ga('adc.send', 'pageview');

		jQuery(".adc-vendor-tile ").click(function (e){
			e.preventDefault();
			ga('adc.send', 'event', 'ProductTile', 'click', jQuery(e.currentTarget).data("uid"), {
				hitCallback : function (){
					location.href = jQuery(e.currentTarget).attr("href");
				}
			});
		})

		jQuery(".adc-category-filter").change(function (e){
			ga('adc.send', 'event', 'Search', 'category', jQuery(".adc-category-filter").val()+"-"+jQuery("select.adc-category-filter option:selected").text());
		});

		jQuery(document).bind("adc.search", function (e, text){
			ga('adc.send', 'event', 'Search', 'text', text);
		})

	})

  
</script>
<!-- End Google Analytics -->
<? endif;?>