Gifting Memberships with Givy
This guide walks you through enabling gifting for Inveterate memberships using the Givy app on any Shopify page. It ensures the gifting modal launches with the correct variant for your membership and selling plan to support recurring billing.
This solution requires the use of a third party app called Givy, available in the Shopify App Store.
This is an advanced theme customization meant for developers that not is supported by the Inveterate team. You should ensure you have the appropriate development resources to implement before proceeding.
Install the Givy App
Go to the Givy App Listing on the Shopify App Store, click "Install" and complete the installation
Enable the Givy App Embed
In Shopify admin, go to Online Store > Themes
Click Customize on the theme you're working on
In the left sidebar, open the App Embeds tab
Locate Givy and toggle it on
Click Save
This enables the JavaScript necessary for launching the Givy modal on your storefront.
Configure the Givy App Modal
In Shopify admin, go to Apps > Givy
In the Givy dashboard, click "Storefront Assets" from the top menu
Open the "General" tab
Use the available settings to configure the appearance of the Givy modal
Save your changes
This ensures the gifting experience is visually consistent with your storefront.
Create a Gifting Script Snippet
Go to Online Store > Themes > Edit code
Under the "Snippets" directory, click "Add a new snippet"
Name it:
givy-membership-gifting.liquid
Paste the following code, replace the placeholder values with your membership’s Variant ID and Selling Plan ID, and save:
<script>
function launchGivyMembershipGift() {
const variantId = '12345678901234'; // Replace with your Shopify Variant ID
const sellingPlanId = '567890123456'; // Replace with your Shopify Selling Plan ID
let attempts = 0;
const maxAttempts = 50;
const interval = setInterval(function() {
attempts++;
if (window.GIVY && typeof window.GIVY.displayModal === 'function') {
clearInterval(interval);
window.GIVY.displayModal(variantId, {
displaySubscriptionOptions: true,
initialSelectedSellingPlanId: sellingPlanId,
addToCartSuccessCallback: function() {
window.location.href = '/cart';
},
addToCartFailCallback: function() {
console.warn("Givy: Add to cart failed.");
}
});
} else if (attempts >= maxAttempts) {
clearInterval(interval);
alert("Something went wrong while loading the gifting modal. Please refresh and try again.");
}
}, 100);
}
</script>
Add the Gifting Button to your Storefront
There are two separate approaches to this step, select the option most suitable for you, but do not complete both.
Option 1: Paste the following code directly in a Liquid file in your theme where you would like it to display.
{% render 'givy-membership-gifting' %}
<button onclick="launchGivyMembershipGift()">
Gift a Membership
</button>
Option 2: Add through Theme Editor using a Custom Liquid block
Go to Online Store > Themes > Customize
Navigate to the desired page or template
Click Add block within a section
Select "Custom Liquid"
Paste the following code:
{% render 'givy-membership-gifting' %}
<button onclick="launchGivyMembershipGift()">
Gift a Membership
</button>
Style the Gifting Button
To customize the button's appearance, add this CSS style block along with the button code & adjust the placeholders to match your theme & branding needs:
<style>
.givy-gift-button {
background-color: #6b3fc9;
color: #ffffff;
padding: 12px 24px;
border: none;
border-radius: 9999px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease;
}
.givy-gift-button:hover {
background-color: #592db5;
}
</style>
Test the Setup
Visit the storefront page where you have placed the gifting button.
Open your browser’s developer console to check for any errors
Click the button and ensure the Givy modal appears with your membership pre-selected
Complete a test to verify the gift is added to cart and redirects correctly
Once completed successfully, upon clicking the "Gift a Membership" button, you should see a modal resembling this pop up, where you can complete the gifting flow:

Last updated
Was this helpful?