About creating a direct add to cart link

I have Google Merchant Center connected to Shopify, but with the need of multiple feed label, I have a very long and unique product id for the product in GMC (“feed name”“product id”“variant id”. But in Google, it requires you to contain the {id} of the product in order to have the “buy now” button. and i cannot have the same product id as it would show error in GMC.

and for Shopify, it requires variant id and the quantity. making it impossible to have a add to cart link. I want to have the “buy now” button, but as i add something like variant id_US:1, it would not work. is there a way to work around it?

In your data feed, it should have access to the variant id.

simply create a checkout_link_template attribute with the value

https://example.com/cart/123456789:1

change example.com to your domain

change 123456789 with the variant id

This should all be possible dynamically in your data feed solution.

But it seems that if i do so, the "buy now " button will not show up anymore in google shopping. Is it because of the requirement of having the {id} from google merchant centre?

So if it was working before, why are you changing it?