How to display "Sessions attributed to marketing" data in custom Application

TeamAccu
New Member
4 0 0

Hello everyone,

We are developing one Custom Shopify Application, in Application, we want to fetch data from Admin >> Analytics >> Report >>  Sessions attributed to marketing

Can someone please guide me whats is the best way to get this data with API? I read it's possible with ShopifyQL but I am afraid users who don't have Advanced and Shopify Plus cant uses my Application then. Is it possible to retrieve "Sessions attributed to marketing" with Graph API or REST API? 

 

Replies 7 (7)

CloudlabSam
Shopify Partner
526 42 85

ShopifyQL is no longer supported. The best way to get what you are after is by using the CustomerJourney object associated with each order. You can get this using the GraphQL API.

TeamAccu
New Member
4 0 0

Hi, Thank you so much for your advice 🙂 So with GraphQL API, I can retrieve data inside the "Sessions attributed to marketing" Report? i just need data in numbers. 

CloudlabSam
Shopify Partner
526 42 85

No - there is no way in Shopify to retrieve data represented in any of their reports. You will need to retrieve transactional data from the API and assemble the data yourself. We've been through all of this, we have a reporting app in the store.

TeamAccu
New Member
4 0 0

Alright got it. Thank you so much for your help.

TeamAccu
New Member
4 0 0

Hi Buddy, I am almost done with my task with rest API but stuck with one small issue can you guide me with it.

I want to grab the last 30 days' order with since id. But I am not able to retrieve it.  When I try the below query its fetches order from the last 60 days is reversed. The example I want to retrieve order from 20 august but its automatically takes order id 60 days ago as first and display just 250 order. 

This is my code will you please help : 

$orders = shopify_call($token, $shop, "/admin/api/2021-07/orders.json", array('fields'=>'id,landing_site','status'=>'any','limit'=>250,'since_id'=>'0'), 'GET');
CloudlabSam
Shopify Partner
526 42 85

Hi - unfortunately, you can't control the order of the results. You need to manage them by paging through until you get what you need.

tyde57
Visitor
1 0 0

I am looking to display the same sessions attribute to marketing in applications but facing the same issues regarding it and need help to solve this issue.