Shopify / js-buy-sdk

The JS Buy SDK is a lightweight library that allows you to build ecommerce into any website. It is based on Shopify's API and provides the ability to retrieve products and collections from your shop, add products to a cart, and checkout.
https://shopify.github.io/js-buy-sdk
MIT License
990 stars 262 forks source link

Documentation for JS Buy SDK and Google Analytics integration? #250

Closed nocean closed 5 years ago

nocean commented 8 years ago

Is there any documentation on best practices for integrating Google Analytics with the JS Buy SDK? A list of GA events that Shopify uses that could be mirrored in an JS Buy SDK implementation?

alfsaav commented 7 years ago

@nocean Hi there, just wanted to check with you. Are you able to track medium/source parameters for ad campaigns (adwords/facebook)? We lose those paremeters at the of the checkout flow (chekcout.shopify.com), any help on this would be greatly appreciated.

nocean commented 7 years ago

We're not using them, but off the top of my head, I would guess that Shopify's GA integration (for checkout.shopify.com) would track them, and so you'd just have to build the checkout URL for the SDK's cart's "checkout" button to include them dynamically.

alfsaav commented 7 years ago

Actually they don't get carried automatically, I got a response from a different thread here. @minasmart provides a great response on how to deal with this, I will test it and report back. here is the link to the other article #281 https://github.com/Shopify/js-buy-sdk/issues/281#issuecomment-268017441

Thanks for following up. I will update the other thread with my results.

Andriy-Kulak commented 7 years ago

@alfsaav Did it work? I am just beginning to build my application and will need to implement this exact feature in the next couple of weeks as well.

alfsaav commented 7 years ago

@Andriy-Kulak Yes it worked, just follow the instructions in the other linked threads.