I want to add analytics and reports to my application on Google App Engine. Can you tell me how I can do that on google's "database"? Are there any oss libraries/tools available?
Thank you
Look at the new Map Reduce API (it doesn't contain reduce yet, but that's what Google calls it anyway).
This makes it easy to map over all the entities of a type in your datastore and count the things you're interested in.
Christopher O'Donnell has an article about using the Mapper API for analytics. He creates time slices (hour, day, month) ahead of time and maps over those to store the data for each time slice.
Related
I am interested in triggering notifications into my Salesforce system when reviews are posted on my Google Business profile.
Using this article, it describes being able to call the Salesforce API by executing Python code using Google's App Engine, leaving very little for me to code myself but I'm not familiar with how Google works in terms of billing.
Essentially when a topic/subscription is triggered, Google will execute a small python script to call the Salesforce API. I want to know how much will it cost to do this, or how can I calculate how this will be billed?
You must be referring to Cloud Functions because that's the product used in the article (also, Cloud Functions has Pub/Sub event trigger). App Engine and Cloud Functions are both serverless products but they have different use cases. If you wish to know the difference between them, here's a good SO answer.
You are billed depending on how long the function takes to finish, how many times you invoke it, and the type of resources configured on the function (the higher the CPU & memory is, the higher the cost). There's additional charges as well if your function makes outbound data transfer whenever you invoke the function.
You can estimate your monthly cost by checking out GCP pricing calculator. Also, there are several products involved on the article (such as Secret Manager and Pub/Sub) so take note of adding these products on your estimate. For additional pricing details, check out the docs: https://cloud.google.com/functions/pricing
I also have another advice though this is not about the pricing when invoking the function but more of the additional when deploying it. From GCP docs:
When you deploy your function's source code to Cloud Functions, that source is stored in a Cloud Storage bucket. Cloud Build then automatically builds your code into a container image and pushes that image to Container Registry. Cloud Functions accesses this image when it needs to run the container to execute your function.
This apply on newer runtimes. It may be noticeable on your billing if you frequently deploy/update a function because Cloud Build has to re-build those images and those images has to be stored on a Cloud Storage bucket. Functions take time to deploy so it's best practice to test your functions first locally. A solution is to use Functions Framework.
I am somewhat new to Web development - specifically Google App Engine and JavaScript/HTML development, but I have an app deployed and working on Google App Engine and it is working ok.
I would like a user of my App to be able to store and retrieve a serialization of the app state in JSON using the GAE Datastore. (Note - This is only a user-initiated action - so channels seem to be overkill)
The examples provided by Google demonstrates one approach that allows the server-side Python implementation to do this. Specifically https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingdatastore. I have this working ok.
But this approach seems rather inelegant especially if as an "app" I want to store and retrieve serialized chunks of data somewhat asynchronously without reloading the page/app each time (again, this is only ever user-initiated).
I have not been able to find any high-level guidance on an approach to do that (assuming it is possible).
Any suggestions/links/examples would be greatly appreciated.
Thank you!
Jeff
As with many things, this depends on your specific needs. If you just want direct access to datastore storage, the datastore is exposed as an independent service with an API.
If you instead want to assert logic over the usage and interact with your app in some fashion, you may also want to look at Google Cloud Endpoints. With an endpoints API, you gain a more structured API you can call directly from javascript, or generate client libraries to be consumed by other languages/platforms.
I used Google Checkout API for getting subscriptions reports every half an hour.
https://checkout.google.com/api/checkout/v2/reports/Merchant/
(https://developers.google.com/checkout/developer/Google_Checkout_XML_API_Order_Report_API)
Our company have ours support team which provides help for users of application. My script downloaded last purchases every half an hour and stored in DB (time,serialnumber,email). After that support was getting access to this information through our web-interface (thus, we did not give an access (login,pass) for a main Checkout account).
Now Google Checkout was shut down and I don't understand how to do it at Google Wallet. Does anyone now can it provide this functionality or not?
AFAIK there currently is no similar "infrastructure" (reporting, querying, etc, via API like in Google Checkout) for Google Wallet for Digital Goods which, based on your comments, sounds like the product you are looking for (to replace your current Google Checkout implementation) - it's specifically for digital goods and does support subscriptions.
You'd manage orders via Merchant Center.
You will get order data via postbacks so as for ideas - you would need to store order data on your end when you handle the postback/s from Google - for both "placed" and "cancelled".
This would replace how you currently do it via Order Report API in Google Checkout...
Hth...
Well, I've been building some free apps on top of appengine, but now I want to start charging money. My question is:
What is the best way to collect payments from users. Do certain services (paypal, google checkout, etc) work better/worse with AppEngine's library restrictions? Are there any good examples or tutorials to help me learn how to do this?
You can do this any way you want, really - and there's nothing App Engine specific about it. For example, you could use Google Checkout or Paypal, and charge users on any basis you want.
Also just something to point out about the implementation, a simple boolean property on your user object should allow you to easily turn functions in your app on and off, depending on which tier your user has paid for.
Checkout http://Spreedly.com or http://Recurly.com. Both are billing solution SaaS apps. http based api's and easy to use. I use Spreedly.com
If you plan to sell business apps you could integrate with the Google Apps Marketplace which uses Google Checkout for billing.
Simple Task: keep track of web traffic (hits) so that I can graph the number of hits per day for the last 30 days.
Current Datastore Model (2 fields): 1) Website ID 2) Timestamp of Hit
Problem: I'm using Google App Engine's datastore and don't have the ability to do a group-by or count.
Can anyone offer a simple way to structure my Google Datastore database to achieve this task? By returning all of the hits and then grouping them in my code seems like a performance hog. Any ideas?
I would use sharding counters for this specific task; have a look to the last example of this documentation.