Accessing Session Data via Latest Shopify GraphQL API

Hi,

I’m looking for a way to retrieve session data through the latest version of the Shopify GraphQL API. Specifically, I want to access metrics such as sessions, online_store_visitors, utm_source, utm_medium, and referrer_source, but I’m seeing that maybe this isn’t possible via the API.

Right now, I have to manually download and send reports, but I’d like to automate this process using the API instead. To give you an idea, here’s the ShopifyQL query I currently use in reports:

Is there a way to achieve this via GraphQL? If not, what would be the recommended approach to programmatically access session-related data?

Thanks for your help!

Your best bet might be to use Google Analytics or something similar. The API currently doesn’t provide data on things like site visits to specific pages/ resources. The closest would be the marketingEngagementCreate mutation which lets you track customer activity related to marketing events before they reach the website. You can aggregate data such as views, clicks, and ad spend for specific marketing activities.

But session/ traffic analysis is not accessible via the API.

1 Like

Hi @Liam-Shopify, is access to session related data planned in the future for GraphQL api?