Ecommerce Shopify WordPress Discussion

Creating GraphiQL request to filter orders by referralCode or utmParameters

I am creating a shopify app where I will query the orders at a shopify website from my backend to detect the orders that were referred by my site. I use utm parameters at the initial page that I direct users to and they are passed properly all the way to order_completed. I can get the utm parameters at the customerJourney of an order. The challenge is that I only want to get orders related to me as seeing all orders of a store would cause data breach. Is there a way to achieve that at GraphiQL filter? If not, what would be your guidance to achieve this in other ways? Something like below but the query does not seem to filter properly. Alternative to utm, I could use referralCode but the filtering question still remain... { orders( first: 100 query: "created_at:>='2024-02-21' AND customerJourney.moments.utmParameters.source:test_keyword" reverse: true ) { edges { node { name id createdAt channelInformation { id } currentTotalPriceSet { presentmentMoney { amount } } customer { id } customerJourneySummary { firstVisit { landingPage } lastVisit { landingPage } } customerJourney { moments { ... on CustomerVisit { utmParameters { source campaign content medium term } } } } } } } }
It's not possible, at the moment these are the only filters that you can use when querying an order (from here https://shopify.dev/docs/api/admin-graphql/2024-01/queries/orders): cart_token channel channel_id chargeback_status checkout_token confirmation_number created_at credit_card_last4 customer_id delivery_method discount_code email financial_status fraud_protection_level fulfillment_location_id fulfillment_status gateway location_id name payment_id payment_provider_id po_number processed_at reference_location_id return_status risk_level sales_channel sku source_identifier source_name status tag tag_not test updated_at If none of those fields can help you, I suggest you to tag the order with flow (you should be able to use the buyer journey there) and then search for the tag.

February 26, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.