Cross-Domain Google Analytics with Buy Button

Highlighted
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
Highlighted
New Member
2 0 0

Still having issues here. Anyone have some insight?

0 Likes
Highlighted
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
Highlighted
New Member
4 0 0

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

0 Likes
Highlighted
Shopify Staff
Shopify Staff
516 100 96

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? Click Accept as Solution 


0 Likes
Highlighted
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

1 Like