I am using Firestore to figure out, in real-time, each user's share of the cost of an item. Example:
/tickets/100/ticket-item/1:
{
name: 'Red Dead Redemption'
price: '5000'
payers (array of maps): [
{
name: 'John',
share: '1666'
},
{
name: 'Jane',
share: '1667'
},
{
name: 'Jack',
share: '1667'
}
]
}
Given that the max write rate to a document is 1/second, will the write always fail if two users add themselves to the same ticket item doc at the exact same time?
I know that this can be mitigated to an extent by using transactions, but a transaction will only re-execute a finite number of times. Let's say it re-executes up to 5 times. If 6 users write to same ticket item doc at the exact same time, can I expect one of these writes to fail?
I would appreciate any and all advice regarding how to handle this.
will the write always fail if two users add themselves to the same ticket item doc at the exact same time?
Yes it will. So if you are sure you'll have situations in which two or even more users will try to write/update data in a single document in the exact same time, I recommend you to be careful about this limitation because you might start to see some of this write operations to fail.
I know that this can be mitigated to an extent by using transactions
It's a good idea but please be aware that transactions will fail when the client is offline.
If 6 users write to same ticket item doc at the exact same time, can I expect one of these writes to fail?
As the docs states, a transaction will only re-execute a finite number of times. But please also note that in case of a transaction failure:
A failed transaction returns an error and does not write anything to the database.
So all you have to do is to take some action in case o transaction failure.
I'm researching same problem.
May be like a solution: moving "payers" into separate collection with a ticket_id field?
So you'll have no limitations.
I'm trying to use the measurement protocol to record an offline purchase on our backend system. The problem is, after I send the Measurement Protocol request, the goal conversion is captured correctly in GA's reports, but the revenue earned from the purchase is always displayed as 0.00 in the reports, even though I am sending a value of 500.00 in the revenue parameter.
Here is the request I am sending to the measurement protocol:
https://www.google-analytics.com/collect?
v=1
&tid=UA-XXXXXXXXXX
&cid=XXXXXXX.XXXXXX
&uid=123
&t=pageview
&dh=http://example.com
&dp=order/thank_you
&dt=thank+you
&ti=127210
&ta=offline+conversion
&tr=500.00
&pa=purchase
&pr1id=1864
&pr1nm=Abc+Program
&pr1ca=Software
&pr1pr=500.00
&cu=CNY
&sc=end
&aip=1
The next day, when I check GA's Conversions reports, the goal conversion is tracked successfully, but the e-commerce report always displays the revenue earned for this purchase as 0.00, even though I've specified the price to be 500.00 in the request. I've already tried the following tasks to resolve the problem, but to no avail:
Double-check that Enhanced E-commerce is enabled in GA (it is).
Change &t=pageview to &t=transaction, but this modification results in neither the goal nor the revenue to be captured in GA.
Re-constructed the request in Google's Hit Builder and validated the hit (it is valid)
Sent the request to /debug/collect to validate the hit (it is valid). Below is the response:
"hitParsingResult": [ {
"valid": true,
"parserMessage": [ {
"messageType": "INFO",
"description": "IP Address from this hit was anonymized to 106.111.63.0.",
"messageCode": "VALUE_MODIFIED"
} ],
"hit": "/debug/collect?v=1\u0026tid=UA-XXXXXXXX-X\u0026cid=XXXXXXXXX.XXXXXXXXXX\u0026uid=123\u0026t=pageview\u0026dh=http%253A%252F%252Fmydomain.com\u0026ti=127210\u0026ta=offline%20conversion\u0026tr=500.00\u0026pa=purchase\u0026pr1id=1864\u0026pr1nm=Abc%20Program\u0026pr1ca=Software\u0026pr1pr=500.00\u0026cu=CNY\u0026sc=end\u0026aip=1"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
Here is the screenshot of the above purchase in GA's conversion reports:
As shown above, the revenue from the purchase is 0.00, even though the revenue I sent to GA is 500.00.
Any idea why Google is not tracking the revenue?
Would also appreciate any thoughts on how to better troubleshoot this issue... because Google's /debug/collect script is not providing much insight into the problem. Any idea what other approaches to take for troubleshooting this?
Thanks!
Okay, found the problem. I didn't include the quantity of product purchased in the request data. In order for revenue to be tracked, you not only have to provide the product price (pr1pr), you also have to provide the product quantity (pr1qt).
So, I added the following parameter into the Measurement Protocol request:
&pr1qt=1
And now revenue is being tracked successfully.
I am doing an application where I extract the google reviews using google places API.When I read the document related to it in "https://developers.google.com/maps/documentation/javascript/places",I found out that I could get only 5 top reviews.Is there any option to get more reviews.
In order to have access to more than 5 reviews with the Google API you have to purchase Premium data Access from Google.
That premium plan will grant you access to all sorts of additional data points you have to shell out a pretty penny.
If you are a Business owner wanting to retrieve all of your reviews, you can do so but first you have to get verified and could do this through the MyBusiness API more info here: https://developers.google.com/my-business/
There is a feature request for that: Issue 7630: Response to Include More Than 5 Reviews ─ I'd recommend you "star" it to receive updates.
Unfortunately there's no way to get more than 5 reviews in the places API unless you are the business owner after getting verified as Tekill said.
But it looks like there are some external services that can get all the reviews. My guess is that they scrape them from Google Maps directly:
Some of these services are Wextractor, ReviewShake and AllReviews
Alternatively, you can use a third party solution like SerpApi to scrape all the reviews of any place. It's a paid API with a free trial.
Each page fatches 10 results. To implement the pagination just use the start parameter which defines the result offset (e.g., 0 (default) is the first page of results, 10 is the 2nd page of results, 20 is the 3rd page of results, etc.)
Example python code (available in other libraries also):
from serpapi import GoogleSearch
params = {
"engine": "google_maps_reviews",
"place_id": "0x89c259a61c75684f:0x79d31adb123348d2",
"api_key": "SECRET_API_KEY"
}
search = GoogleSearch(params)
results = search.get_dict()
reviews = results['reviews']
Example output:
"reviews": [
{
"user": {
"name": "Waylon Bilbrey",
"link": "https://www.google.com/maps/contrib/107691056156160235121?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARAx",
"thumbnail": "https://lh3.googleusercontent.com/a-/AOh14GjOj6Wjfk1kSYjhvH7WIBNMdl4nPj6FvUhvYcR6=s40-c0x00000000-cc-rp",
"reviews": 1
},
"rating": 4,
"date": "a week ago",
"snippet": "I've been here multiple times. The coffee itself is just average to me. The service is good (the people working are nice). The aesthetic is obviously what brings the place some fame. A little overpriced (even for NY). A very small cup for $6 where I feel like the price comes from the top rainbow foam decor , when I'm going to cover it anyways. If it's for an insta pic then it may be worth it?"
},
{
"user": {
"name": "Amber Grace Sale",
"link": "https://www.google.com/maps/contrib/106390058588469541899?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARA7",
"thumbnail": "https://lh3.googleusercontent.com/a-/AOh14Gj84nHu_9V_0V4yRbZcr-8ZTYAHua6gUBP8fC7W=s40-c0x00000000-cc-rp-ba3",
"local_guide": true,
"reviews": 33,
"photos": 17
},
"rating": 5,
"date": "2 years ago",
"snippet": "They really take pride in their espresso roast here and the staff is extremely knowledgeable on the subject. It’s also a GREAT place to do work although a table is no guarantee; you might have to wait for a bit. My almond milk cappuccino was very acidic at the end which wasn’t expected but I could still tell the bean was high quality. Their larger lattés they put in a tall glass cup which looks really really cool. Would definitely go again.",
"likes": 2,
"images": [
"https://lh5.googleusercontent.com/p/AF1QipMup24_dHrWtNN4ZD70EPsiRMf_tykcUkPw6A1H=w100-h100-p-n-k-no"
]
},
{
"user": {
"name": "Kelvin Petar",
"link": "https://www.google.com/maps/contrib/100859090874785206875?hl=en-US&sa=X&ved=2ahUKEwiUituIlpTvAhVYCc0KHbvTCrgQvvQBegQIARBG",
"thumbnail": "https://lh3.googleusercontent.com/a-/AOh14GhdIvUDamzfPqbYIpwhnGJV2XWSi77iVXfEsiKS=s40-c0x00000000-cc-rp",
"reviews": 3
},
"rating": 4,
"date": "3 months ago",
"snippet": "Stumptown Cafe is the perfect place to work or catch up with friends. Never too loud, never too dead. Their lattes and deliciously addicting and the toasts are tasty as well. Wifi is always fast, which is a huge plus! The staff are the friendliest, I highly recommend this place!"
},
...
]
You can check out the documentation for more details.
Disclaimer: I work at SerpApi.
Adding to the answer of #miguev, there's at the moment no way to get more than 5 top reviews without using premium APIs (according to a Google Maps guy I had a talk with) and that's pricey.
We tried to sign for The Google Maps Platform Premium Plan to show them on pages like this but Google said it's no longer available for sign up or new customers. Right now we're limited to 5 reviews only.
In iTunesConnect you can open rss feeds for the customer reviews of your app:
https://itunes.apple.com/us/rss/customerreviews/id=123/sortBy=mostRecent/xml
https://itunes.apple.com/de/rss/customerreviews/id=123/sortBy=mostRecent/xml
The top level folder (us/de/..) of the URL changes for each country, the parameter id is the store id of the app. (here 123)
With rss2email you can check the feeds and send an email when somebody posts a review. So far, so good.
My problem is, that in iTunesConnect there are only six countries in the dropdown, where somebody has actually posted a review. But I cannot find out, what other country codes (us/de/..) there are, so I will miss reviews from other countries.
I have tried parsing possible codes from this page and got 73 two character codes:
http://www.apple.com/choose-your-country/
But this has resulted in most reviews triggering up to five emails and I don't see, which country codes have caused them or if there might be stores with codes longer than two characters.
Does anyone maybe know, how/where to get a list of all valid countries/appstores without those causing duplicates?
edit: i could not add tags for "rss2email" and "customerreviews" ..
You can use the country list of the Country dropdown input list of the following url:
http://itunes.apple.com/rss/
Probably you got the question resolved by now but in following link you can check appstore country codes: AppStore Territories
https://itunes.apple.com/lookup?id=[app-id]&country=[country-code]
Example URL: https://itunes.apple.com/lookup?id=297606951&country=us
Example Response:
{
"resultCount": 1,
"results": [{
"supportedDevices": ["iPhone5s-iPhone5s", "iPadAir-iPadAir", "iPadAirCellular-iPadAirCellular", "iPadMiniRetina-iPadMiniRetina", "iPadMiniRetinaCellular-iPadMiniRetinaCellular", "iPhone6-iPhone6", "iPhone6Plus-iPhone6Plus", "iPadAir2-iPadAir2", "iPadAir2Cellular-iPadAir2Cellular", "iPadMini3-iPadMini3", "iPadMini3Cellular-iPadMini3Cellular", "iPodTouchSixthGen-iPodTouchSixthGen", "iPhone6s-iPhone6s", "iPhone6sPlus-iPhone6sPlus", "iPadMini4-iPadMini4", "iPadMini4Cellular-iPadMini4Cellular", "iPadPro-iPadPro", "iPadProCellular-iPadProCellular", "iPadPro97-iPadPro97", "iPadPro97Cellular-iPadPro97Cellular", "iPhoneSE-iPhoneSE", "iPhone7-iPhone7", "iPhone7Plus-iPhone7Plus", "iPad611-iPad611", "iPad612-iPad612", "iPad71-iPad71", "iPad72-iPad72", "iPad73-iPad73", "iPad74-iPad74", "iPhone8-iPhone8", "iPhone8Plus-iPhone8Plus", "iPhoneX-iPhoneX", "iPad75-iPad75", "iPad76-iPad76", "iPhoneXS-iPhoneXS", "iPhoneXSMax-iPhoneXSMax", "iPhoneXR-iPhoneXR", "iPad812-iPad812", "iPad834-iPad834", "iPad856-iPad856", "iPad878-iPad878", "iPadMini5-iPadMini5", "iPadMini5Cellular-iPadMini5Cellular", "iPadAir3-iPadAir3", "iPadAir3Cellular-iPadAir3Cellular", "iPodTouchSeventhGen-iPodTouchSeventhGen", "iPhone11-iPhone11", "iPhone11Pro-iPhone11Pro", "iPadSeventhGen-iPadSeventhGen", "iPadSeventhGenCellular-iPadSeventhGenCellular", "iPhone11ProMax-iPhone11ProMax", "iPhoneSESecondGen-iPhoneSESecondGen", "iPadProSecondGen-iPadProSecondGen", "iPadProSecondGenCellular-iPadProSecondGenCellular", "iPadProFourthGen-iPadProFourthGen", "iPadProFourthGenCellular-iPadProFourthGenCellular", "iPhone12Mini-iPhone12Mini", "iPhone12-iPhone12", "iPhone12Pro-iPhone12Pro", "iPhone12ProMax-iPhone12ProMax", "iPadAir4-iPadAir4", "iPadAir4Cellular-iPadAir4Cellular", "iPadEighthGen-iPadEighthGen", "iPadEighthGenCellular-iPadEighthGenCellular", "iPadProThirdGen-iPadProThirdGen", "iPadProThirdGenCellular-iPadProThirdGenCellular", "iPadProFifthGen-iPadProFifthGen", "iPadProFifthGenCellular-iPadProFifthGenCellular", "iPhone13Pro-iPhone13Pro", "iPhone13ProMax-iPhone13ProMax", "iPhone13Mini-iPhone13Mini", "iPhone13-iPhone13", "iPadMiniSixthGen-iPadMiniSixthGen", "iPadMiniSixthGenCellular-iPadMiniSixthGenCellular", "iPadNinthGen-iPadNinthGen", "iPadNinthGenCellular-iPadNinthGenCellular", "iPhoneSEThirdGen-iPhoneSEThirdGen", "iPadAirFifthGen-iPadAirFifthGen", "iPadAirFifthGenCellular-iPadAirFifthGenCellular"],
"features": ["iosUniversal"],
"advisories": [],
"isGameCenterEnabled": false,
"screenshotUrls": [
"https://is1-ssl.mzstatic.com/image/thumb/PurpleSource115/v4/f6/33/7b/f6337b0c-2671-e2b4-002f-0a36fab77e71/17eaa185-7352-4096-b55c-0bae474b4199_Apple_5.5_1242x2208_IntroScreen.png/392x696bb.png",
"https://is2-ssl.mzstatic.com/image/thumb/Purple125/v4/ce/2f/11/ce2f115f-e0df-cf9d-4c72-d0cc4f7091e8/2150888f-4c22-4325-99a9-5d482b1655f9_1242x2208_Screen1.png/392x696bb.png",
"https://is5-ssl.mzstatic.com/image/thumb/Purple115/v4/18/d9/8c/18d98c8b-ac4f-ee10-d6f5-78b83231b361/dc6e2c88-148f-4e8c-bb8b-52a28e6f0964_1242x2208_Screen2.png/392x696bb.png",
"https://is4-ssl.mzstatic.com/image/thumb/Purple125/v4/24/47/4a/24474a84-9822-7713-7756-6ac963cf89bb/098cc97c-bf76-4aca-b1c3-36c7e4219a74_1242x2208_Screen3.png/392x696bb.png",
"https://is1-ssl.mzstatic.com/image/thumb/Purple115/v4/8b/d4/31/8bd43171-4bae-a895-6bba-1a4dd6c019b3/58ae38d7-8318-4e21-a418-2a8de41525f9_1242x2208_Screen4.png/392x696bb.png",
"https://is5-ssl.mzstatic.com/image/thumb/Purple115/v4/94/cf/b6/94cfb621-7843-b73e-8d94-1116bd088796/21c4c003-5d3e-4793-8b58-11b24e5be2af_1242x2208_Screen5.png/392x696bb.png",
"https://is4-ssl.mzstatic.com/image/thumb/Purple115/v4/b7/ff/32/b7ff32fc-40f7-8fbc-c47f-e6199fdd46cc/0d923ffa-5cf0-4fcc-990c-be0252f7e6e5_1242x2208_Screen6.png/392x696bb.png"
],
"ipadScreenshotUrls": ["https://is4-ssl.mzstatic.com/image/thumb/Purple125/v4/b0/da/7a/b0da7a66-25ab-0fc0-704f-b5dc60530566/pr_source.png/576x768bb.png", "https://is4-ssl.mzstatic.com/image/thumb/Purple115/v4/c9/19/ef/c919ef13-664e-0d0f-01fc-0d456b56c2c8/pr_source.png/576x768bb.png", "https://is3-ssl.mzstatic.com/image/thumb/Purple115/v4/28/9e/4a/289e4a6c-6428-53fd-fde1-0efa40e64a78/pr_source.png/576x768bb.png", "https://is1-ssl.mzstatic.com/image/thumb/Purple115/v4/be/1c/67/be1c678b-4f3f-33c3-fbaa-8e8be720911b/pr_source.png/576x768bb.png", "https://is2-ssl.mzstatic.com/image/thumb/Purple125/v4/e1/94/bf/e194bf78-08ea-e419-7bf8-dbb476dbed58/pr_source.png/576x768bb.png", "https://is5-ssl.mzstatic.com/image/thumb/Purple125/v4/92/95/84/929584ee-7825-9d7b-1a65-22a08a337203/pr_source.png/576x768bb.png", "https://is4-ssl.mzstatic.com/image/thumb/Purple115/v4/d8/88/eb/d888eb7d-0203-07e9-0cb7-2bd86e8202c5/pr_source.png/576x768bb.png", "https://is2-ssl.mzstatic.com/image/thumb/Purple125/v4/ed/99/82/ed9982f2-9f91-70f8-7cff-db3be3e24221/pr_source.png/576x768bb.png"],
"appletvScreenshotUrls": [],
"artworkUrl60": "https://is2-ssl.mzstatic.com/image/thumb/Purple112/v4/27/fb/42/27fb42b0-925f-1a86-abe8-4722e884d8bd/AppIcon-1x_U007emarketing-0-6-0-0-85-220-0.png/60x60bb.jpg",
"artworkUrl512": "https://is2-ssl.mzstatic.com/image/thumb/Purple112/v4/27/fb/42/27fb42b0-925f-1a86-abe8-4722e884d8bd/AppIcon-1x_U007emarketing-0-6-0-0-85-220-0.png/512x512bb.jpg",
"artworkUrl100": "https://is2-ssl.mzstatic.com/image/thumb/Purple112/v4/27/fb/42/27fb42b0-925f-1a86-abe8-4722e884d8bd/AppIcon-1x_U007emarketing-0-6-0-0-85-220-0.png/100x100bb.jpg",
"artistViewUrl": "https://apps.apple.com/us/developer/amzn-mobile-llc/id297606954?uo=4",
"kind": "software",
"releaseNotes": "Our new design provides easier access to the features you use most while on the go. This includes the homepage, account and order information, your cart and the ability to browse and discover Amazon departments, products, programs, and features.",
"bundleId": "com.amazon.Amazon",
"primaryGenreName": "Shopping",
"primaryGenreId": 6024,
"sellerName": "AMZN Mobile LLC",
"genreIds": ["6024", "6012"],
"isVppDeviceBasedLicensingEnabled": true,
"currentVersionReleaseDate": "2022-08-22T18:53:31Z",
"currency": "USD",
"trackCensoredName": "Amazon Shopping",
"languageCodesISO2A": ["AR", "EN", "FR", "DE", "IT", "JA", "PT", "ZH", "ES"],
"fileSizeBytes": "163086336",
"sellerUrl": "https://www.amazon.com/",
"formattedPrice": "Free",
"contentAdvisoryRating": "4+",
"averageUserRatingForCurrentVersion": 4.852289999999999992041921359486877918243408203125,
"userRatingCountForCurrentVersion": 7564184,
"averageUserRating": 4.852289999999999992041921359486877918243408203125,
"trackViewUrl": "https://apps.apple.com/us/app/amazon-shopping/id297606951?uo=4",
"trackContentRating": "4+",
"minimumOsVersion": "13.0",
"version": "19.16.0",
"wrapperType": "software",
"releaseDate": "2008-12-03T08:00:00Z",
"trackId": 297606951,
"trackName": "Amazon Shopping",
"artistId": 297606954,
"artistName": "AMZN Mobile LLC",
"genres": ["Shopping", "Lifestyle"],
"price": 0.00,
"description": "Amazon Shopping offers app-only benefits to help make shopping on Amazon faster and easier. Browse, view product details, read reviews, and purchase millions of products. Amazon delivers to 100+ countries in as quickly as 3-5 days. Whether you’re buying gifts, reading reviews, tracking orders, scanning products, or just shopping, the Amazon Shopping app offers more benefits than shopping on Amazon via your desktop. \n\nNever miss a delivery\nGet real-time tracking and delivery notifications so you know where your package is and when it arrives. \n\nKnow exactly what you’re purchasing\nFull 360° product view lets you see items from every angle. “View in you room” makes sure it fits by using your phone’s camera and VR so you can see it in your space. \n\nWe’ll notify you when items go on sale\nJust tap the heart icon to save items to Your Lists and we’ll alert you of price drops so you don’t miss a deal. \n\nNever forget your password\nSave time by staying securely signed in. If you prefer to sign out, use facial or fingerprint identification to sign back in. \n\nConnect with us when it works best for you\nLive chat support is open 24 hours, 7 days a week. Once you’ve started a chat, it stays that way for 24 hours so you don’t have to start your support session from the beginning. \n\nWe’ll find that item for you\nNot sure of an item’s brand or where to but it? Just tap the scan icon in the search bar, take a picture of the item or its barcode, and we’ll find it for you. \n\nIn order to provide a rich experience and enable features such as voice shopping, notifications, visual search, customer reviews, and authentication this app may request permission to access contacts, camera, microphone, notification, touch id, photos and Bluetooth.\n\nAmazon Shopping is available in English, Spanish, German, and Simplified Chinese. In addition to International Shopping, you can change your settings in this single app to shop Amazon.ca, Amazon.co.uk, Amazon.de, Amazon.fr, Amazon.com, Amazon.it, Amazon.es, Amazon.cn, Amazon.co.jp or Amazon.in.\n\nFor customers located within the European Union, United Kingdom or Brazil: By using this app, you agree to Amazon’s Conditions of Use applicable for your country. Please also see the applicable Privacy Notice, Cookies Notice and Interest-Based Ads Notice for your country. Links to these terms and notices can be found in the footer of your local Amazon homepage.\n\nFor all other customers: By using this app, you agree to the applicable Amazon Conditions of Use (e.g. www.amazon.com/conditionsofuse) and Privacy Notice (e.g. www.amazon.com/privacy) for your country. Links to these terms and notices can be found in the footer of your local Amazon homepage.\n\nIf your device supports TrueDepth technology, the app will use your device camera to detect your facial movements only while using certain features such as virtually try-on products like sunglasses. All information processed using this technology remains on your device and is not otherwise stored, processed or shared by Amazon.",
"userRatingCount": 7564184
}]
}