We have a Google Sheet used for generating estimates for customers. Part of the functionality of this sheet is that there is a Confirm Order link generated, which takes the customer directly to Shopify checkout. All of the items and their shipping/billing details are added via URL parameters. We send the customer a PDF of the sheet which includes the link so they can easily checkout.
However, this is making it difficult to set-up abandoned cart/abandoned checkout emails. This is because our team will often test the “Confirm Order” link in our spreadsheet to make sure it’s working properly for a customer. Because all of the details are included, Shopify will sometimes see this as an abandoned checkout.
I’ve added a checkbox in the spreadsheet called “TEST CLICK” that adds the below attribute to the checkout URL. Our sales team can then click this when they want to check if the link works. I can see this attribute showing up in the abandoned checkouts list.
attributes[test_click]=true
I want to now set-up an abandoned checkout automation that does not send an email if test_click=true.
However I see the abandonment object in GraphQL Admin API works completely differently to abandoned checkouts in the REST Admin API.
To exclude test clicks (test_click=true) from triggering abandoned checkout emails, you can implement the following:
1- Filter Based on Custom Attributes:
Shopify’s Abandoned Checkout emails cannot filter directly by custom attributes.
Instead, you need to integrate Shopify with an automation tool like Klaviyo, Omnisend, or a custom webhook. These tools can filter based on attributes in the data.
2- GraphQL Admin API Solution:
Use the checkoutAttributes field in the GraphQL Admin API to detect custom attributes like test_click=true.
Query abandoned checkouts and check for this attribute. Automate an email trigger only when test_click is absent or false.
Example query:
query {
checkouts(first: 10) {
edges {
node {
id
customAttributes {
key
value
}
}
}
}
}
3- REST Admin API Workaround:
If you rely on the REST Admin API, fetch abandoned checkouts and parse the response for note_attributes or similar fields containing test_click.
4- Update Automation Logic:
Set up the automation logic in your email tool or custom system to exclude any checkout where test_click=true.
If using Shopify’s built-in abandoned cart emails, you may need external automation to implement this level of filtering, as native features are limited.
If you have other questions, I will also answer them.