Note: This requires a feed tool and that the eCommerce store has a place on the site indicating the free shipping threshold, as well as all products that have free shipping.
Step 1. Create a Google Sheet with 5 Columns
-
- Country
- Daily Crawl
- Free Shipping Threshold
- Backup
- Amount Sent to Channable
Step 2: Use IMPORTXML to Fetch the Free Shipping Text
=IMPORTXML("URLxxxxxx.xx/", "//div[@class='header-toast__content']/text()[normalize-space()]")
Step 3. Extract the Amount Using REGEX
Then, use REGEX to extract the amount in Column 3. The REGEX formula captures the threshold amount for each country and ensures the value is set to 0 when there is no amount in the fetched text string—for example, during a sale with free shipping on everything.
Example of REGEXEXTRACT:
=IF(OR(ISNUMBER(FIND("/", B2)), ISNUMBER(FIND(" / ", B2)), NOT(REGEXMATCH(B2, "\d+"))), 0, REGEXEXTRACT(B2, "\d+"))
Since the eCommerce store sometimes adds a date like “free shipping until 7/9,” the REGEXEXTRACT
is configured so that there must not be a “/” between numbers. These settings need to be adjusted for each case.
Step 4. Set a Backup Value in Case the Crawl Fails
In Column 4 (Backup if crawl fails), set the last known free shipping value. If the crawl/REGEXEXTRACT
fails, the value sent to the feed will be this backup value.
Step 5. Export from the Sheet
I chose to create a tab for each country for better organization. In the UK sheet right now, I just have a header and then the free shipping threshold.
Go to “Share” in Google Sheets, then “Publish to the web,” and share the sheet for a given country as a CSV file.
This URL is then imported into your feed tool.
Normal day
Sale with “Free shipping”
Step 6: Import the CSV File into Your Feed Tool
In my feed tool (we use Channable), I import the CSV file containing the free shipping threshold value.
I assign the value to the variable freeshipping_threshold. It’s important that the import enriches all products with the incoming value for the next step to work.
In Channable, the import is done via the “Item enrichment” function.
Step 7. Create a Rule in the Feed Tool
In the feed tool, create a rule that compares product_price with freeshipping_threshold and sets shipping_price to 0 if product_price is greater than freeshipping_threshold.
If there’s a sale with free shipping on all products, the threshold will be 0. All products will be above this threshold and thus be assigned 0 in shipping_price, displaying “Free Shipping” in the Shopping ads.
Images of the Sheet:
Normal Free Shipping Thresholds
Day with Free Shipping
Do You Also Want to Include This in Your Text Ads?
This setup can also be used to globally change ad texts so that they include the message about free shipping when applicable.
Step 8. Add “Free Shipping” to Your Text Ads
To include “Free Shipping” as a message in text ads generated in, for example, Channable, simply create rules that change the text when freeshipping_threshold is 0.
Indlægget How to Automatically Include “Free Shipping” in Your Shopping and Text Ads | savvytactic blev først udgivet på savvyrevenue.