Buy Button + Affiliate = Not possible?

New Member
3 0 0

So, we've been playing around with the Buy Button and can't seem to get it to work with our affiliate marketing platform Refersion. 

- The buy button code for a specific product is as below... 

- and we replaced the URL for the button to append the refersion affiliate code as provided (in bold below). 

However, even though the button works and the sale goes through, the sale doesnt get recorded in refersion possibly due to the affiliate code getting list somewhere in the flow. Anyone been able to get affiliate codes to work with the buy button feature? 

<div data-embed_type="product" data-shop="" data-product_name="Manhattan Moonshine" data-product_handle="manhattan-moonshine" data-has_image="false" data-display_size="compact" data-redirect_to="cart" data-buy_button_text="Add To Cart" data-buy_button_out_of_stock_text="Out of Stock" data-buy_button_product_unavailable_text="Unavailable" data-button_background_color="000000" data-button_text_color="ffffff" data-product_modal="false" data-product_title_color="000000" data-next_page_button_text="Next page"></div>
<script type="text/javascript">
document.getElementById('ShopifyEmbedScript') || document.write('<script type="text/javascript" src=""; id="ShopifyEmbedScript"><\/script>');
<noscript><a href="" target="_blank">Buy Manhattan Moonshine</a></noscript>

Sample page: ;


Shopify Staff (Retired)
Shopify Staff (Retired)
400 0 68

Hi Adi,

Britton here with the Shopify support team.

I think I can see at least one issue with the code above. The <noscript> tag in html is only triggered when the person viewing the page has set their broswer to not run any on page javascript. So, for your code above, that link that you changed will only come into play for users that have their browsers set to not run javascript. This is a small percentage of internet users. If you want to test if it works, turn off your javascript functionality and then try to use your Buy Button. If you see a referral in Refersion, then that part works for people who have set their browsers to not run JavaScript!

It looks like otherwise the actual links are pulled in dynamically using javascript and are not straightforwardly editable in the way that you want. You might still be able to rewrite it so that it works, but it will likely be more complicated than just editing a URL. Reaching out to an Expert for this is one way you could go:

I hope that clears up the issue for you a bit :)


Britton Shopify Guru
Shopify Partner
11 0 2

Hi Adi,

I was wondering if you found a way to get affiliate links work with Buy Buttons? Especially the collection buy button.

Would appreciate any help here.

Best Regards

Shopify Expert
166 0 41

Hi. We (at Elkfox) are able to create custom embedded collections, products and carts that include things like custom referral URLs, custom styling and more.

Get in touch if you would like to find out what we could do for you.

Elkfox - The eCommerce Experts