What is Gift ID and can I remove/hide it? (Dr Free Gift, BOGO Buy X Get Y Shopify App)
APP SETUP
CREATE FREE GIFTS
HOW TO'S
PROMOTE YOUR FREE GIFT
GIFT INVENTORY
GIFT FRAUD
FAQS
TROUBLESHOOTING
When managing multiple gift promotions in your Shopify store with Dr Free Gift, BOGO Buy X Get Y app, you may notice a “Gift ID” property appearing next to free items in your cart. While this identifier serves an essential purpose for tracking and managing gifts, some store owners prefer to hide it from customer view. This article explains what Gift IDs are, why they’re necessary, and how to manage their visibility in your store.
Understanding Gift IDs
A Gift ID is a unique identifier automatically added to free gift items in your cart as a line item property. This ID serves several crucial functions:
- Links free gifts to their qualifying goals
- Differentiates between identical products offered as gifts for different promotions
- Ensures proper gift tracking and order fulfillment
- Maintains gift associations throughout the checkout process
The Gift ID property becomes particularly important when:
- Multiple goals offer the same product as a gift
- Customers qualify for multiple gifts simultaneously
- Different promotional tiers provide varying gift combinations
Why Gift IDs Are Necessary
Gift IDs play a vital role in maintaining the integrity of your gift promotion system by:
- Goal Association: When multiple promotions offer the same product as a gift, the Gift ID helps track which specific promotion triggered each gift.
- System Tracking: It enables accurate monitoring of gift distribution and promotion effectiveness.
Understanding How Gift IDs Appear in Your Cart
When our app adds a gift to the cart, it includes the Gift ID as a line item property in Shopify’s cart system. Most Shopify themes are designed to automatically display all line item properties, which is why you see the Gift ID in your cart. This is a standard Shopify feature that many themes and apps rely on for various functionalities.
Managing Gift ID Visibility
While Gift IDs are essential for system functionality, you can control their visibility. Here are two approaches, but remember that implementation details may vary depending on your specific theme:
Option 1: Hide Gift IDs Using CSS
You can hide Gift IDs while maintaining their functionality by adding CSS to your theme. The exact CSS classes will depend on your theme’s structure, but here are some common examples:
- Go to your theme customization settings
- Access your theme’s CSS editor
- Add CSS code to hide the Gift ID property. The exact classes may vary by theme, for example:
/* Note: These are example classes – your theme may use different ones */
.cart-item__property[data-property=”Gift ID”] {
display: none;
}
/* Or */
.cart-item__details dl {
display: none;
}
/* Or potentially */
.line-item-property__field:has([name*=”Gift ID”]) {
display: none;
}
To find the correct CSS classes for your theme:
- Use your browser’s inspect element tool on the Gift ID text in your cart
- Look for the containing element’s class names
- Adjust the CSS selector accordingly
Option 2: Modify Cart Template
For a more permanent solution, you can modify how your cart template handles line item properties:
- Access your theme’s cart template file (usually cart.liquid *cart-items.liquid or similar)
- Look for the section that displays line item properties
- Add a condition to exclude Gift ID properties. The exact code structure may vary by theme, but here’s a common example:
{% for property in item.properties %}
{% unless property.first contains ‘Gift ID’ %}
<div class=”line-item-property”>
{{ property.first }}: {{ property.last }}
</div>
{% endunless %}
{% endfor %}
Note: The actual template structure and property display logic may differ in your theme.
Important Considerations
Before modifying Gift ID visibility:
- Maintain Functionality: Remember that hiding Gift IDs doesn’t remove them from the system – they continue working behind the scenes.
- Theme Updates: Custom CSS or template modifications might need to be reapplied after theme updates.
- Testing: Always test your cart and checkout process after making these changes to ensure everything works correctly.
- Support: Keep in mind that Gift IDs might be helpful when seeking support for gift-related issues.
Conclusion
While Gift IDs are essential for proper gift promotion functionality, you have options for controlling their visibility in your store. Whether you choose to hide them with CSS or modify your cart template, ensure you maintain the underlying functionality while creating a cleaner customer experience.
Remember that Gift IDs can still appear in your order data and admin interface. Choose the visibility management method that best balances your store’s aesthetic preferences with functional requirements.