How can I change the URL of my gift card in my online store?

Topic summary

Issue: Gift card emails redirect recipients to checkout.shopify.com instead of the store’s custom domain (yourdomain.com/gift_cards/...), causing broken links and incorrect branding on the gift card landing page.

Primary Solution (Email Notifications):

  • Edit the “Gift card created” notification template in Shopify admin
  • Replace {{ gift_card.url }} with {{ gift_card.url | replace: "checkout.shopify.com", "yourdomain.com" }}
  • Multiple users confirmed this works for email notifications

SMS Notifications:

  • Requires modified code that includes both the original URL (for Shopify validation) and the replaced version
  • Users reported initial “page not found” errors when implementing, often due to incorrect domain formatting (www vs non-www, or using /giftcards/ instead of /gift_cards/)

Multi-language Sites:

  • One user shared advanced code that handles language-specific URLs (e.g., domain.com/DE/gift_cards/)
  • Uses Liquid logic to dynamically insert language codes into the gift card path

Cautions:

  • One participant warned this workaround may break if Shopify changes their system
  • Some third-party themes may affect gift card URL behavior
  • The discussion remains open with ongoing troubleshooting for edge cases
Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hey Guys,

I have recently found a problem with my gift card. When I send a gift card to someone, they will be linked to a address start with “checkout.shopify.com”. However, it should be “mystoredomain.com/gift_cards/...something”. So I look up on shopify help center, there is an article says

gift_card.url> > Returns the unique URL that links to the gift card’s page on the shop (rendered throughgift_card.liquid).

But I couldn’t find any code that render the url for my gift card.

Can someone help me with that!

Thanks

Hi @MACRORY ,

Could you please send Store URL in order to check the actual URL?

Hi,

I am having the same issue as well, in Settings > Notifications > Gift card created, the code for the gift page link in the email template is this: View your gift card. The gift_card.url is: ‘checkout.shopify.com’ URL and not the shop domain. This means that when they click on the link, land on the ‘checkout.shopify.com/gift_cards’ page, all the links and search bar URL on the page are incorrect.

I can see you resolved this issue, but have not stated how it was resolved.

as you might have guessed we have the same issue. Can you advise on the solution please?

HI @SamAM Did you ever get a reply on how this issue was fixed? We are experiencing the same thing and I am having a hard time troubleshooting.

Hey [email removed]Kate1c2 thanks for your reply. No we heard absolutely nothing. In the end we just disabled the feature. Its very frustrating as we would love to use them. Let me know how you go, if you are able to make progress?

@SamAM @Kate1c2

Hey Guys, sorry for the late reply. Basically, the gift card email sent from Shopify redirect customer to a checkout.shopify.com/gift_cards/xxx address. However, the gift card still works if you change checkout.shopify.com to yourdomain.com/gift_cards/xxx There are few options you could do.

  1. Change the URL your send to customer in your email notification template.

Change the following elment in your Email Notification

{{ gift_card.url }}

to something like

{{ gift_card.url | replace: "checkout.shopify.com", "yourdomain.com"}}
  1. Redirect your customers when they go to your checkout.shopify.com page

Add javascript to your gift_card.liquid that identify the current url, if it is checkout.shopify.com/gift_cards/xxx … ,then redirect your customer to Loading...

You could search on stackoverflow to achieve this option

2 Likes

Much appreciated for this information @MACRORY !

@SamAM Additionally, after chatting with a Shopify Guru person as well, they determined that when we changed our theme within the last couple of months that our new theme we chose has some impact over this link not working too. If you are using a third party theme, that could also be the issue. We are using the prestige theme. The theme developer has reached out so I will let you know if they are able to fix it. They might also be using the same thing that @MACRORY mentioned above!

Best of luck!

Oh my word. Thank you for your swift reply. I just implement option 1 and it works completely. Thank you so much this is such a help to us.

@MACRORY is correct but missed a little something. For most third-party themes, this is how the notification code will look for the gift card URL:


Makes sure to keep those quotation marks at the end. This is how it will look once you change it to your URL:

```markup
2 Likes

I tried to follow this but I cannot find <a href=“{{ gift_card.url }}” in the code in the edit code gift card page. Is the code correct or am I doing something wrong?

Hi @jenni2

I was a bit unclear. You don’t edit the code of the theme. You edit the code of the notification email for Gift card created. This link will take you straight to where you’re supposed to make changes.

Thank you so much! It worked! :slightly_smiling_face:

@jenni2 Glad it did!

Hey macrory, the url change works fine for the e-mail but not working for the SMS. Can you please help me out with this as it is redirecting to the checkout.shopify.com.

Hey techsolver, the url change works fine for the e-mail but not working for the SMS. Can you please help me out with this as it is redirecting to the checkout.shopify.com.

@Salmank4 I got it! Since Shopify makes you include the gift care url as is, you have to trick it. Copy and paste the below code:

Here's your {{ gift_card.balance | money_without_trailing_zeros }} {{shop.name}} gift card:{{ {{ gift_card.url }} {{ gift_card.url | replace: "checkout.shopify.com", "www.yoursite.com" }} . {% if gift_card.expires_on %} This gift card expires on {{ gift_card.expires_on }} {% endif%}

@TechSolver thanks for the reply! I tried the code you suggested and once i clicked on the link it says page not found. :disappointed_face:

@Salmank4 The code I posted above is correct. You just need to replace your domain name in there, and the rest will happen magically.

@TechSolver i just found out the reason why it says page not found that’s because when i received the url it had https://www.mywebsite.com/giftcards/ but it is supposed to have gift_card in the url path and i made the change and i see it worked!