A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We are using checkoutCreate api to get the checkout url, and manually appending UTM params when clicks happen that should track in the Shopify dashboard but the link is getting changed and not reflecting the count in the shopify once we redirected.
Below is the URL we are currently
https://thedivashop.ng/27201732651/checkouts/e27174ef08bd73af82ab9fdf38927aa1?key=ffdfeb33f28050ba01...
API URL we are using https://the-diva-shop-nigeria.myshopify.com/api/2023-07/graphql.json
and the body
{
"query": "mutation CheckoutCreate($input: CheckoutCreateInput!) { checkoutCreate(input: $input) { checkout { id orderStatusUrl requiresShipping totalPrice { amount currencyCode } subtotalPrice { amount currencyCode } webUrl customAttributes {key value} } } }",
"variables": {
"input": {
"lineItems": [
{
"quantity": 1,
"variantId": "gid://shopify/ProductVariant/40187816345643"
}
],
"customAttributes": [
{
"key": "utm_source",
"value": "WhatsappSales"
},
{
"key": "utm_medium",
"value": "whatsapp-sales"
},
{
"key": "utm_campaign",
"value": "WhatsappSales"
}
]
}
}
}
also we tried to add customattributes as well it didn't work please help
Hey @srinivascr1999
Are you doing a fresh CheckoutCreate each time the values change?
Can you elaborate on "not reflecting the count in the shopify once we redirected."?
I just ran a test using CheckoutCreate with customAttributes and these attributes were visible in the admin once the order completed.
Moving forward, consider using cartCreate / cartAttributesUpdate mutations.
Scott | Developer Advocate @ Shopify
Yes, we are creating fresh CheckoutCreate each time,
Actually, once we receive the checkout URL from checkourcreate API we are appending UTM params for the tracking purpose. but when we click on the link, the format is changed and not reflected and tracked in the Shopify dashboard.
Above Is the client's Shopify Dashboard, WA sales count should be tracked
Below is the WA checkout link for the reference.
Then if us the attribute / cartAttributesUPdate will it appends to the same URL??
Will sharing you sample response which we are getting now
We appending utms to webURL
{"data":{"checkoutCreate":{"checkout":{"id":"gid://shopify/Checkout/b094a4894876e7caa2dad1ffa00b93f9?key=113ef04c5f10e340bd7fc02e262d64d2","orderStatusUrl":null,"requiresShipping":true,"totalPrice":{"amount":"1333.0","currencyCode":"NGN"},"subtotalPrice":{"amount":"1333.0","currencyCode":"NGN"},"webUrl":"https://the-diva-shop-nigeria.myshopify.com/27201732651/checkouts/b094a4894876e7caa2dad1ffa00b93f9?key=113ef04c5f10e340bd7fc02e262d64d2","customAttributes":[{"key":"utm_source","value":"WhatsappSales"},{"key":"utm_medium","value":"whatsapp-sales"},{"key":"utm_campaign","value":"WhatsappSales"}]}}}}
Checking if there's a way to do this that would reflect in the reporting. Will report back!
Scott | Developer Advocate @ Shopify