If you are selling products in store that require an additional terms of service or purchase agreement, it’s important that you can track this in Shopify. This might include terms of service for products with an ongoing service agreement, data consent, or simple email marketing consent.
You may want to do this on the customer level using customer tags, or, you may want to track consent against individual products.
In any case, using the ShopFields app you can collect customer consent quickly and easily.
One way to do this would be to create a simple binary (yes/no) custom field in the custom fields app. Your field might look like this:
Then, in Shopify POS, marking off whether the customer has agreed to the terms of service is as simple as:
Once applied, the field will show up on the order in point of sale.
Now that the field has been applied, we can use Shopify Flow to handle any follow-on actions. This might include:
There’s lot of ways to extend and customise this to suit your needs too. Perhaps you want to offer consent on individual products, or instead of a binary yes/no option you have a list where the customer can choose what level of consent or marketing they are comfortable with.
When clicking ‘accepts marketing’ in Shopify POS, either in the customer’s profile or checkout, the customer will be subscribed to email marketing, but not SMS marketing. Using ShopFields and Shopify Flow you can automate this process and update a customer’s SMS marketing consent.
Before enabling, make sure you understand and follow your region’s privacy rules for collecting SMS marketing consent.
To set this up all we need to do is:
First I create a field in the ShopFields app. Note the “key” is “accepts_sms” and I’m using a true / false field. I’m also using an order field instead of applying the field to individual items in the cart.
Next I create a Flow using the free Shopify Flow app. It simply:
Here’s each step in detail (I’d recommend opening the image in a new tab if needed):
There are a two things you will need to update in your HTTP Request action:
Here are the fields:
URL
https://{YOUR-STORE}.myshopify.com/admin/api/2023-10/graphql.json
Headers
X-Shopify-Access-Token : { Your Admin API Access Token}
Content-Type : application/json
Body
Credit for the GraphQL request goes to Kevnob’s post on the Shopify community
{
"query": "mutation customerSMSMarketingConsentUpdate($input: CustomerSmsMarketingConsentUpdateInput!) {\n customerSmsMarketingConsentUpdate(input: $input) {\n customer {\n id\n smsMarketingConsent {\n marketingState\n consentUpdatedAt\n marketingOptInLevel\n }\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": {
"input": {
"customerId": "{{order.customer.id}}",
"smsMarketingConsent": {
"marketingOptInLevel": "SINGLE_OPT_IN",
"marketingState": "SUBSCRIBED"
}
}
}
}
Now that it’s all set up, when a staff member adds the field to that order, the customer’s SMS marketing consent will be updated.
If you’re running into issues, the first thing to check is the Flow run history. If there’s any errors they should be logged there. Check you’ve added your HTTP Request fields in correctly, and that the customer has a phoine number, as this is required to enable SMS marketing consent.
You may want to extend this flow to tag the customer, to handle unsubscriptions, or only subscribe under certain conditions. You might want to change the API version as well.