Shopify display Most viewed Products via API - google-analytics-api

I've been working to develop a shopify app. I've used Shopify API to display data like, Top Products, Top Customers etc.
Now i want to display products based on their number of views in ascending or descending order.
How can i achieve that using Shopify API?
If It is not possible via API and I need to integrate Google Analytics to it, then is there any guide that can tell me how to get products views data from the store?
Any help would save my day.

Related

Is it possible to embed Google Analytics eCommerce dashboard into swift application

I'm building a swift app with the purpose of showing GA ecommerce sales from multiple vendors on my website. Each vendor can register on the app and then the access of their sales data will be granted to their user so they can follow their sales.
The ecommerce tracking is preformed by Google Analytics so is there any way where I can embed my eCommerce dashboards onto my swift app?
You can not.
There's no such API available for that intent, the way you want it. You must use theirs...
I am very sorry to tell you, but its is the plain truth.
Welcome!

2 separate facebook pixels - one integrated into shopify, one on GTM - How to make it work?

I have a fairly unique business model in which I need to use a retail partner to sell my produce because licensing is difficult. They have to collect money and transfer it to supplies on my behalf so my product must be sold on their site.
They have their own acquisition campaigns running through facebook and therefor have a facebook pixel passing data for those ads and it's directly integrated into shopify. Our products end up just being another sku on their site but we would like to also support those with facebook ads so would need to have our pixel as well. Unfortunately shopify only allows one tracking code from facebook.
Would there be any issue is setting our facebook pixel up on Google Tag Manager (we have the container across their site) and expecting it to fire in parallel with the pixel that they have integrated into shopify?
Followup, same scenario for Google Analytics, Google Adwords, etc.
Thanks!

How to dynamically change content depending on data from Facebook analytics?

Facebook have deprecated their app notifications API so there is no way to push content to a users phone based on segments anymore, correct me if I'm wrong.
The problem is that I want to analyse Facebook analytic data programatically and display different products to my customers based on how they use the app, to do this I need access to Facebook analytics through a PHP SDK or JavaScript SDK. How do I access Facebook analytics programatically? I can't find anything in their PHP SDK which would let me do this.
Furthermore, I want to push notifications to specific segments of users, now that Facebook have deprecated their app notifications API, how can this be accomplished?
Could it be worth switching to Firebase / Google analytics, would these services allow me to accomplish these tasks?
Thanks
Analytics is primarily about post-event analysis, vs real-time optimization. All of the products you mention focus on post-event analysis and don't support you reading data out for a single individual (i.e. the current user), through an API or otherwise.

Facebook.com/offers tab - Is there any way to get offers id data?

Noticed recently that facebook has moved all the Offers data from user feed to Offers tab (under app) section.
Wondering if there's a way to get offers Ids from this tab? or perhaps any-other way to pull offers Ids for the user.
Offer can be accessed by going to www.facebook.com/offers.

Export Google Analytics chart for specific URL

I would like to show a graph of visitors (eg. 7 days back) on a specific subpage on my website - not the entire site!
I've been looking at:
http://www.jensbits.com/2010/06/23/google-analytics-data-export-api-with-google-chart-visualizations-2/
.. but i cant figure out how to show a graph for a specific url/subpage.
Any ideas?
Follow these steps
1.Go to your Google Analytics Account.
2.Click on the 'gear' icon. It will show you 3 tabs-> Profile, Tracking Code and Property Settings. Click on Tracking Code.
Under What are you tracking? select A Single Domain radio button. It will show you its corresponding options on the right. Select I want to track PHP pages. It will show you the tracking code underneath. Copy paste the code in the php file/page you are willing to track.
Dont worry about the query parameters. They will be identified automatically with respect to the tracking code. So if your page identifies 100 different layouts with respect to the parameters, they will show up in your analytics account.
Use the following Api to export data from your account
Google Analytics PHP API
Then, after you have received the data, you can set up an ajax request that fetches the data from your PHP script and embeds it in your site using a javascript API chart builder. This is also available with Google
Google Charts API
Hope that helps. All the best!