Analytics API not working?

Solved
Shopify Partner
10 0 1

Hi everyone, I'm creating an Embedded App using the Embedded App SDK.

So far so good, however, when I tried the example in the Analytics API documentation, I did not get any response.

Here's my code:

    ShopifyApp.ready(function(){
      console.log('Shopify app is ready');
      var shopifyQL = "SHOW count() FROM visits SINCE -2w UNTIL today";

      var renderData = function(response) {
        console.log('Response!');
        console.log(response);
        // do amazing things here
      };
      var handleError = function(response) {
        console.log('Error!');
        // handle missing API errors here (missing scopes, back shopifyql, etc...)
      };

      ShopifyApp.Analytics.fetch({
        query: shopifyQL,
        success: renderData,
        error: handleError
      });
    });

 

I would have expected an `Error!` or `Response!` on my console, but only `Shopify app is ready` prints out. Any ideas on why I'm not getting a response?

 

Thanks,

Nicole

1 Like
Shopify Partner
1 0 1

Hey Nicole, any luck with it? i see the same issue


@Nicole_Tan wrote:

Hi everyone, I'm creating an Embedded App using the Embedded App SDK.

So far so good, however, when I tried the example in the Analytics API documentation, I did not get any response.

Here's my code:

    ShopifyApp.ready(function(){
      console.log('Shopify app is ready');
      var shopifyQL = "SHOW count() FROM visits SINCE -2w UNTIL today";

      var renderData = function(response) {
        console.log('Response!');
        console.log(response);
        // do amazing things here
      };
      var handleError = function(response) {
        console.log('Error!');
        // handle missing API errors here (missing scopes, back shopifyql, etc...)
      };

      ShopifyApp.Analytics.fetch({
        query: shopifyQL,
        success: renderData,
        error: handleError
      });
    });

 

I would have expected an `Error!` or `Response!` on my console, but only `Shopify app is ready` prints out. Any ideas on why I'm not getting a response?

 

Thanks,

Nicole


 

1 Like
New Member
1 0 0

Hi everyone,
I have created
Embedded App using the Embedded App SDK.

when I tried the example in the Analytics API documentation, I did not get any response.

This is my example code that i used to retrive data using API.

 

    ShopifyApp.ready(function(){      console.log('Shopify app is ready');
      var shopifyQL = "SHOW sum(pageview_count) OVER day(timestamp) FROM visits SINCE -1d UNTIL today";
console.log(shopifyQL);
var renderData = function(response) {
console.log(response); // do amazing things here }; var handleError = function(response) { console.log('Error!'); // handle missing API errors here (missing scopes, back shopifyql, etc...) };
ShopifyApp.Analytics.fetch({
query: shopifyQL,
success: renderData,
error: handleError
});
});

I also reached out to shopify support, they have special tool which is not availble to merchants to use, in that tool they have tested this Shopify QL and they get result.

 

Any help will be appreciated here.

 

Thanks,

Sid

0 Likes
Shopify Staff
Shopify Staff
1546 77 231

Hey everyone.

 

It's very possible I'm going to need to enable something on our end to get this working for you for the time being. For anyone who's having issues, would you mind sharing your app ID and I can take a look? You can find this at the end of the URL when viewing your app in the partner dashboard. Eg. https://partners.shopify.com/333072/apps/2498989.

 

It's worth noting: you will not be able to use Shopify App Bridge if I apply this change. As long as that's ok with you, and you're ok with using only the Embedded App SDK, I can enable the feature. Sorry for the headaches.

 

Cheers.

 

EDIT

 


@Alex wrote:

For any new requests

 

Let's try sending me a direct message on the forums if you need access to the analytics API granted. You should be able to click the envelope icon beside your user profile picture on the top right. From there you can create a new message and address it to me. Please make sure to include your app ID as mentioned earlier in this thread.




0 Likes
Highlighted
New Member
8 0 0

Hi @Alex seems like the URL does not work any more. Could you please tell me how can I communicate the details of my APP to fix this? Is possible to the update from your end to my account so I no longer have to reach out to fix this? Also, what's the plan? I mean, how shopify team is working on migrating to the App Bridge cause I saw nothing that indicates Analytics with the SAB.

0 Likes
Shopify Staff
Shopify Staff
1546 77 231

@AbdelilahLbardi if you're referring to the URL I referenced in my last post, it's just meant to be an example of how you would get your app's ID (the bold part). If you need this switched on for your app in the short term, let me know your app ID and I can get it working for you.

 

At this time unfortunately the fix has to be implemented manually on my end. We're currently having conversations on our end on how to best handle the Analytics API going forward. That may include migrating it into app bridge, moving it into its own library, etc. I understand this has been a bit of a headache from your point of view, sorry about that one. We'll hopefully have a solution in production soon.

0 Likes

@Alex Hi.Alex

I want to analytics api and having this issue.

My app ID is below 3 apps.

 

2662899
2662901
2662893

so. please apply fixes.

0 Likes
Shopify Staff
Shopify Staff
1546 77 231

@fujinaga-fracta done, you should be all set.

0 Likes
New Member
8 0 0

Hi @Alex, thanks a billion for getting back to me about this matter. Here's the APP ID:

 

2766083

 

I was playing a bite withe the new App Bridge and it looks really cool. When are you guys planning to add the suppor of the Analytics API to? If it's already done, I don't find anything that mentions that in the documentation and would be happy to receive instructions from your side.

 

Thank you.

0 Likes
Shopify Staff
Shopify Staff
1546 77 231

@AbdelilahLbardi done.

 

At this time I don't have a reliable time frame I can give for this one. Just know we're absolutely talking about it internally, and at the end of the day the goal of course is to get more people using App Bridge!

 

Cheers.

0 Likes