There is an app that can fulfill your need, if you wanna try the 3rd-party one, give a try on this BOGO+ Buy X Get Y & Free Gift.
With BOGO+, you can offer gift based on cart value. For example, if the cart value reached $100, the gift would be automatically added to the cart. Or you can show the gift via pop-up notification.
For better visualization, you can check in the demo store.
Currently, the built-in Shopify “Buy X Get Y” discount doesn’t automatically add a free gift to the cart. Instead, customers still have to manually add the free gift themselves to apply the discount.
If you’re looking to fully automate this (auto-add/remove based on cart value), it’d require a third-party app. Once customer meet the threshold, they will have the gift right away in their cart.
You can do this by writing a Shopify Script (for Plus) or a JavaScript/Liquid function in your theme. Use cart logic to check when the cart total passes your threshold, then use Shopify’s AJAX API to add the gift product variant ID automatically. Now we’re cutting out third-party apps completely.
Based on your requirements, if you’re open to using a third-party app, we recommend trying the Discount Ray – Wholesale Pricing app.
This app includes a Personalized Discount feature that allows you to automatically add a free gift product to the cart when a customer reaches a specific spending threshold. The gift product will be preselected automatically, so customers don’t need to choose it themselves.
You can check out the demo product we’ve uploaded for reference.
The app also offers a 14-day free trial, allowing you to explore its features before making a decision.
If you’d like, we can also share a sample product setup to help you get started.