Cross-Domain Google Analytics with Buy Button

Geoffrey1
New Member
2 0 0

We currently have Google Analytics enabled on our website as well as our Shopify store. We're using the Buy Button to integrate Shopify with our website. Currently, GA Events that occur via the embedded Buy Button cart correctly pass the "Source / Medium" through to GA, which is expected as it's on the same domain (our website, unfolded.com).

However, once a user decides to checkout, that opens a pop-up window that is now loading from the Shopify domain. The GA events setup through Shopify (Completed Order, Started Order, etc) work just fine, except their "Source / Medium" is always either "Direct" or "unfolded.com", which makes sense since the users are arriving there via our website. Is there a way, though, to carry over the "Source / Medium" that originally brought them to our website (unfolded.com) over through to the Shopify pop-up so we can more accurately get a sense of where people completing those actions came from?

0 Likes
Geoffrey1
New Member
2 0 0

Still having issues here. Anyone have some insight?

0 Likes
ShopShopMan
New Member
2 0 0

I am in a similar situation. Our ufnnel breaks when we are directed to checkout.shopify.com and the user basically finalizes the purchase from this point on. This is due to the nature of cross-domain. As far as i could understand, shopify did introduce checkout on own domain, but it doesn't seem to be work with Buy Button for unknown reasons. https://www.shopify.com/blog/introducing-checkout-on-your-own-domain 

0 Likes
naterock101
New Member
4 0 0

@ShopShopMan @Geoffrey1 were either of you either to figure this out? Im currently having the same issue

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 105

With the Buy Button, you can have a custom domain with a simple edit. If you open the Buy Button code you will see a section that looks like this: 

 

  function ShopifyBuyInit() {
    var client = ShopifyBuy.buildClient({
      domain: 'insert-custom-domain.com',
      storefrontAccessToken: '12345..........',
    });

You can add a domain to this section where i've highlighted `insert-custom-domain`. Otherwise, you will need to setup cross-domain tracking in GA. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
topo
New Member
1 0 1

Hi Vix,

I am having the exact same issue.

I have removed the iframe from the Buy button with iframe: false. And I added the "domain" variable as suggested in your last comment (+ listed the domain in GA's referral exclusion list).

But the traffic clicking on the Buy Button is still categorized as direct traffic in GA with landing page = "/checkout/contact_information".

Any other recommendations on how to solve this?

Thanks

im1313
New Member
1 0 0

We're also having this problem and desperate to resolve. We have a wordpress site with a buy button set up going to external shopify domain, attributing sales to 'direct'. One developer told us to rebuild the entire site on shopify, thus keeping the transactions all under the same domain - seems like an extreme (and expensive!) solution. Looking to try something in-between first if anyone has anymore successful feedback please?

0 Likes