adsense management api give diffrent results than website - adsense-api

adsense management api give me different results than the website interface.
the simplest example:
run the report here:
https://developers.google.com/adsense/management/v1.4/reference/accounts/reports/generate
I want to see the rpm by countries for given AD_UNIT_NAME for some date
this the request:(xxxx is censored
https://www.googleapis.com/adsense/v1.4/accounts/pub-xxxx/reports?startDate=2014-05-01&endDate=2014-05-01&dimension=COUNTRY_CODE&filter=AD_UNIT_NAME%3D%3D160%2F600+-+xxxx&metric=AD_REQUESTS_RPM&key=xxxx
I get the results as excepted the problem is when i go the adsense website and click on the same ad unit name, and add country dimension I see different results.. i checked it a lot of times with all kind of differents request(for example clicks instead of rpm or different ad unit or without country dimensions and so on).
the api always give different results than adsense interface why is that?
api results example:
[
"BR",
"5.10"
]
adsense website results for same ad:
brazil: 7.64
what i tried:
make sure same currency.
make sure same dates.
check different dates.
check its the same ad.
check different ads.
etc.

so after long time I found the answer:
different time zone...
all was needed was to set useTimezoneReporting to true.
I think it should be the default value..

Related

Phone number for testing Stripe connect standard account onboarding?

I'm testing onboarding for a a Standard Stripe Connect account, following the docs and using the phone number 00000000000 but:
I've tried 9 zeros and 10 zeros but both give the same result. I also tried removing the country prefix, but you have to select a country (removing country code is not an option).
Docs do say:
Force-skip the account form instead of having to fill out an entire account application (Standard)
But what if I want to see what customers see? Is that simply not possible, even in test mode?
That test phone number is specifically for Express onboarding, with Standard you'd skip the form entirely as you pointed out.
If you want to see what customers see, you could add a real phone number to get through the flow but stop short of actually submitting the form.

Custom tags applied to Azure web app pages in Azure Application Insights

Use case: Categorizing page views in an Azure web app for analytics reporting
Using Azure Application Insights, I can see a list of pages in an Azure web app and its number of views in the past X days.
The web app is a documentation website. I would like to categorize each page with a tag like install-info or api-doc or intro-material, etc. The goal is that I can easily see information like "X number of page views were around install information" or "API pages received 25% of traffic," etc.
Currently I am exporting a table of each page and its number of views. Then I manually categorize each page in Excel. There are hundreds of pages. I would love to export a table that included a third column showing the page's custom tag.
Looking at Microsoft documentation, it sounds like this is possible with custom coding and the API, but I would like a simpler strategy if one exists, as I am not a sophisticated coder.
If there are alternative methods of achieving my goal than the solution I'm asking about in this question, I would be grateful to know.
Thank you.
If I understood you correctly, you want to add an extra tag(column) for different kind of url, right?
If that's the case, you can take use of case and extend statement of kusto.
Here is an sample code:
pageViews
| where name contains "WebApplication5"
| extend mytags = case(
//here, I'm using name for each condition, you can use other field as per your need.
name=="Home Page - WebApplication5","index page",
name=="Privacy Policy - WebApplication5","privacy page",
"others"
)
| project name,mytags
Then export the result. The test result is as below:
Please feel free to modify this code to meet your requirement, and also let me know if you still have more issues about that.

No AdSense Impressions on a site newly converted to Drupal 8

I am scratching my head trying to figure out (and yes, I know there are multiple reasons this could be happening) why my AdSense Impressions have dropped to 0 after changing my site to Drupal 8.6.4.
I have installed the Drupal AdSense module, into which I've put my "pub-XYZ~~" account number.
I left it like that for several days thinking perhaps the crawler hadn't found it. Then I got cold feet and thought perhaps it wasn't working, especially since I didn't see any AdSense code appearing in the source of the page.
So I added the following code via Asset Injector into the head of the page:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-239656292892567776",
enable_page_level_ads: true
});
</script>
(That's not my real client ID, just random numbers.)
Now I see a line of script in the head of the page:
<script src="/sites/default/files/js/js_Gc2nyd2PQaQJQwlbfhfc8Yz8TwWRl90UGM3vTenwS8s.js"></script>
And that (if I click on it) opens up the Google AdSense code I've written above.
Yet I've waited two or three days more, still not seeing any impressions, page visits, CTR (every metric on my "Performance" report is zero), and I am concerned that maybe I've done something wrong.
So does anyone know, if I'm using the Drupal AdSense module, where do I see the code?
And two, if I'm using the module, where can I see the code appearing in the source? (The Google answer doc says "You can do this by viewing the source of your site from a browser and double-checking that the ad code looks exactly like the code we provide you in your account, and includes every line of the ad code." But in the Drupal AdSense module, the only field is one for that pub-XYZ~~~ number, and nothing else, and as I mentioned, I'm not finding the code anywhere in the site when I view the source.
Three, if I'm using the module, will it mess things up to have the code above put in via the Asset Injector?
And lastly, am I just too worried and the AdSense module is doing what it should and I should check back in 10 days or 20, rather than in 5 or 7?
Thank you for any help. I had just installed AdSense (by adding it to the head of the page, this exact code) on the old site before switching to Drupal, and it was definitely working then, so I know that the issue isn't that the site isn't approved or the account's invalid or such. It WAS working fine. But after this move to Drupal 8, it's completely failed and I just don't know which link of the chain is the one I should fix. I have been scouring both Drupal docs and AdSense docs for this issue/answers and haven't found anything that seems to be the issue...and I really am hoping to know if the code side of it is correct.
Again, thank you in advance!
Okay, so for anyone else who needs this info, I'm answering my own question: I never did get the Google AdSense "auto ads" to work on my site, and am pretty sure the reason they didn't is that I was trying the "auto ads" code rather than the on-the-page, placed ads type code. I still don't know if it was simply a matter of time and the crawler hadn't found my site again, or if I had incorrect code, or what.
But I am now seeing an ad on my site, and what worked for me was:
Turn off any AdSense code in the head of the page. (I had injected the script via Asset Injector, and I disabled that.)
Make sure Drupal's AdSense module is running. DEselect the option that asks people if they wish to turn off their adblocker. The only thing I added in AdSense's main config window was my "pub-XYZ~" number.
Ditch the Google "auto ad" option and do the "Ad Units" option, creating an ad in AdSense. (AdSense > Ads > Ad Units). Do everything there and get your ad ID#.
Back to Drupal: Either create a new custom block or use one of the Drupal AdSense options to create a block on your site. If you use an Drupal AdSense option, it prompts you for the info needed to display the right ad. You'll need that ad ID# info at the very least.
Make sure that block is placed on your page. I chose "Responsive" but presumably this works for all the options. Fixed size, etc. I believe you could also (if you wanted) simply place the Google code directly into a custom block and use that. It seems people do.
If you've done it right, logged into your Drupal site, with the block placed, it will show placeholder text with your pub-# and ad ID#, in a little box. You won't see an actual ad (this is in the "Help and Information" option at the top of the AdSense module config). If you're seeing the placeholder box, it's a good sign that everything's going well with the Drupal AdSense module side of it.
Then wait, and wait, and eventually, logged out, on a private browser window, you should see the ad when the crawler finds it and other magic happens. I waited about 24 hours after setting this whole thing up before seeing an ad appear.
(Please note that this all was with a site that had a working AdSense account and had previously been getting lots of impressions for the ads. So if you don't have those aspects set up initially, none of the above will work either.)

When checking in via foursquare API, I do NOT show up in Here Now

Not sure if this is related to this question (seems to be but I cannot comment only answer and I don't have one yet but would like to add my experience with this issue).
There are 3 foursquare apps I use on my Windows Phone. The official app, 4th & Mayor, and my own app. I've also experienced this via foursquare.com/mobile checkins.
Using the official app and my app, when I checkin to a venue, I do not show up in "Here Now" whether from phone apps or on the website or looking at the json from the API calls. When checking my "last seen at" it shows me there.
Using 4th & Mayor it's hit or miss. Sometimes I'll show up in "Here Now" (within all apps and the website) and sometimes I don't.
One thing to note, when it finally does show me in "Here Now" at a venue, if I checkin to another venue and I do NOT show up in "Here Now", "Here Now" for the old venue still shows me there, so it's not clearing that out. "Last seen at" shows me in the new venue.
I'm not checking in off the grid and I do have the "Include me in the public list of people who are currently checked in at a venue" checked. Even tried unchecking it and checking it back. I've tried with 2 different accounts and I've tried with and without shouts, with and without sharing to facebook and twitter, and the normal and quick checkin options. All with the same results.
NOTE that I'm not just relying on the apps showing me that I'm at a venue, I'm looking at the raw json returned from the API, both from my app and the API Explorer # developer.foursquare.com.
If it helps, here's the HTTP Post from my app (venue and oauth token removed):
https://api.foursquare.com/v2/checkins/add?broadcast=public,facebook&venueId=the_venue_id&oauth_token=my_token&v=20111030
I've even tried changing the version to &v=20120107 and it still doesn't work.
I've also logged out everwhere I could think of and even disconnected my facebook and twitter accounts.
It is only recently this has started, within the past couple days.
So, in summary,
When I checkin I do not show up in Here Now, either from the venues/VENUE_ID endpoint, the venues/search endpoint (I'm not counted in the here now), or the venues/VENUE_ID/herenow endpoint.
My checkin does show up via users/self and via the checkins/recent endpoint.
Apps used: foursquare for Windows Phone, 4th & Mayor, my own Windows Phone app, and foursquare.com/mobile.
You may not appear in herenow for a variety of reasons:
1) If a user checks in without a lat/lng, we consider that a record-keeping check-in and may not display the user in herenow since we have no idea if they are actually there or not
2) If the user checks in with a lat/lng that is sufficiently far away from the venue, we may not display the user in herenow.
Looking at your request, it would appear that you're not passing your current lat/lng to the API, which would likely put you in case (1).
The official app + 4th & Mayor should be passing your lat/lng as reported by your phone. The only reason I can think that herenow wouldn't update is if you're checking in to a venue you are not near to, or if your phone has a poor GPS look.
If you do start passing lat/lngs to the API servers, be sure that you are reporting the user's actual location as reported by an impartial device (like the phone's OS). Failure to do otherwise may cause your application to be disabled without notice.

Why does Google Analytics show less visits than One&One stats?

Comparing google analytics results to one&one hosting monthly statics shows a huge discrepancy.
For last month:
Google shows 1046 visits.
One&one stats show 15304 unique visits.
The google code is in the footer which appears on every page.
I'm aware ga only works with js enabled but to assume that many non js users???
Google Analytics is a good indicator of how many humans are visiting your website.
Here are some things to check:
how many bots are in your monthly stats? You can usually find something that says User-Agent in your stats page. GoogleBot, Slurp, msnbot & others will be visiting every page on your site.
that you've read Google Analytics' definition of a visit.
that you have read what your statistics provider means by unique visit. Does that mean unique visitor, page view or something else?
Raw hits on servers can be misleading for a number of reasons..
If you have external style sheets & JavaScript etc, they could be counted as a hit in the webserver log
RSS feed readers will periodically update without being asked to by a human
Check the page views in Google Analytics - it's possible that 1&1 is tracking unique page views instead of the actual visits.
Google Analytics works for almost all users (I believe less than 5% have JS disabled). I have had the same discrepancy, in my case the difference was zeroed out when I took into account the bots (which server-side statistics often take into account, as they produce http-requests). You probably have the same "problem".
Neither stats are wrong, they just count different things. Google Analytics is the more "accurate", i.e. the numbers you want to take a look at. The hosting stats, which look only at http requests, often without filtering, are less interesting.
Blogger, and probably other sites, serve a different page template or skin to mobile visitors. In my case, that template didn't contain the google analytics snippet of code and so those hits were uncounted, until I noticed and fixed it.

Resources