I want to fetch store order conversion rate through api to third party portal. Is there any specific api available for that or any specific category available for that? Can you please tell me the specific api or category of that api?
Hi Sourav,
Shopify does not provide a direct API endpoint specifically for order conversion rates, but you can retrieve the necessary data to calculate it.
Here’s a high-level approach to achieve this:
- Fetch Orders Data: Use the orders query to retrieve orders data. You can filter orders by date or other criteria to get the relevant data for your conversion rate calculation.
- Fetch Visitor Data: Use an analytics tool or service (eg: Google Analytics) that tracks visitor data to get number of visitors.
- Calculate Conversion Rate: Once you have both the number of orders and the number of visitors, you can calculate the conversion rate using the formula: [ \text{Conversion Rate} = \left(\frac{\text{Number of Orders}}{\text{Number of Visitors}}\right) \times 100 ]
To integrate this into a third-party portal, you would need to periodically fetch this data, perform the calculation, and then send the results to your portal.
Hi Liam,
Thanks for your response. Can I know if I can fetch the data of customers who added the products to the cart. As I have to fetch each data mentioned in the screenshot below through api on third party portal.
I have fetch the conversion rate through the formula you have provided. I want to fetch add to cart and reached checkout data as well. Can you help me with this?
Looking forward for your help.
You would have to add custom events via something like GTM og Shopify pixels* through the frontend code. Both Added to cart and Reached checkout could be achieved that way.
Sessions converted could also be tracked through pixels*.
*Pixels/Customer events. More info.
Hi Curzey,
Thanks for your reply. Can I get the store sessions through gtm or is there any specific api available in shopify for that?
Re-thinking it I think a GA4 setup using cookies with a fair expiration time (remember consent in EU). Send start_session
events if the cookie is not set (we assume its a new session then since it’s either never set or expired).
AFAIK theres no such Shopify API.
Hi Curzey,
Thank you for your response. From your reply, I understand that to access analytics details such as abandoned checkouts, abandoned carts (added to cart), session conversions, and online store sessions, I would need to fetch the data through Google Analytics, as there is no API available for these metrics.
Could you please confirm if my understanding is correct?
Looking forward to your clarification.
I’m not sure exactly what you are trying to achieve, or where. But theres no Shopify APIs for it, so the general ways (atleast to my knowledge) of tracking this, is via events through GA.
You could adapt the same structure to any system. Handle session cookie for each user, set whatever expiration-date you think is best, send an event like session_started
on page loads if the cookie does not exist or is not expired.
Where you send the event is up to where you want to handle it.
I’m not very good at tracking, I just implement whatever is needed in the theme code.
Thank you so much for your time and suggestion you gave. I will use it accordingly in my store.