Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I'm using webhooks to capture orders and need session referral attribution information. I'm able to access UTM parameters using the Admin GraphQL; however, I need access to additional landing page query string parameters and/or cookie values. Is there any way to access these latter two items via webhooks.
Solved! Go to the solution
This is an accepted solution.
Hi Curt60 - from looking into this it doesn't seem that you'd be able to access these custom parameters or cookie values via webhooks.
However you should be able to use JavaScript to access the current page's URL using window.location.href and capture the query string paramters that way, while the document.cookie property lets you access cookies. Once you've captured the data you're interested in, you can send it to your server via an AJAX request.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Curt60 - from looking into this it doesn't seem that you'd be able to access these custom parameters or cookie values via webhooks.
However you should be able to use JavaScript to access the current page's URL using window.location.href and capture the query string paramters that way, while the document.cookie property lets you access cookies. Once you've captured the data you're interested in, you can send it to your server via an AJAX request.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks. Yep, makes sense.
Along similar lines, it looks like some apps write the incoming parameters to the 'additional details' section of the order since that is retrievable via webhook.