Created
January 5, 2018 20:07
-
-
Save davidchc/6af382b6af9752bb7078e0bbb53f33c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loopGa = window.setInterval(function(){ | |
if(typeof ga !== 'undefined' ) { | |
ga('require', 'ec'); | |
ga('ec:addProduct', { | |
'id': '<?php echo $product_info["product_id"]?>', | |
'name': '<?php echo $product_info["name"]?>', | |
}); | |
ga('ec:setAction', 'detail'); | |
ga('send', 'pageview'); | |
clearInterval(loopGa); | |
} | |
}, 200); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment