No AdSense Impressions on a site newly converted to Drupal 8 - drupal-modules

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.)

Related

Gmail - Link to Draft in non-conversation view

I am importing/creating drafts in Gmail using the Gmail API. After creation I'd like to redirect the user to the Gmail UI with the opened Draft in the composer window.
I made it work properly for https://mail.google.com/mail/#drafts?compose=[MESSAGE ID]. Other urls I found here also worked well. Gmail is doing some redirects and eventually the composer window is opened with the draft.
Now my issue:
If the user has not enabled "Conversation view" this will not work at all. The redirect will then result in https://mail.google.com/mail/u/0/#drafts?compose=new and only an empty, new composer window is shown and a new draft is created by the UI.
If I open the draft directly the ID-format is different. https://mail.google.com/mail/u/0/#drafts?compose=hJzgZpSqgLQcCWgZqnlNRzRBfMbjZVnZklzvcFxhQCdwT... and I have no idea if this format can be generated somehow.
Does anybody has an idea or experience to also make it work with this UI setting. How I can force Gmail to load the draft into the composer window?
Thanks in advance.
If you have Email Threading > Conversation View enabled
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox?compose=DRAFT_MESSAGE_ID
If you have disabled the Email Threading > Conversation View option
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
Additional information
The main difference between them is that the first is treated as a conversation while the second example is not.
You can use #drafts instead of #inbox in the URL.
The number after .../mail/u/ is the session you have opened
You can retrieve the DRAFT_MESSAGE_ID by making a request to the API
You can approximately generate the compose ID by yourself, there are some examples out there (not recommended). I strongly recommend you to use the DRAFT_MESSAGE_ID instead.
This appears to still be an issue the one solution I did find was that you can find your draft directly (even though it would be the last draft) and go through multiple accounts by redirecting to
https://accounts.google.com/AccountChooser?authuser={user account}&Email={email account}&continue=https://mail.google.com/mail/#search/rfc822msgid:CAMU-31NcJCVHyGNsAycRKfuS0nMonoaZ6wFMD90Sej996qjuPQ#mail.gmail.com
You need to get your message id toi replace the area from <> from your draft. So you'll have to create the draft first. Get the google message ID, then use that with messages/get to get the Global Message Id (also referred to as message id) and then use that with a search. At this point you'll open a page with a search to a single draft but it will not be opened. Your users will have to click on the one message. Unfortunately there does not seem to be a way to have the good way work for conversation view, and this way work for non.
I tried many different URLS and nothing worked. As noted in the original question, it might work that you could link to the full URL but I see no way to get that. If you spend long enough working with an email you'll even find that ID changes so they aren't even stable within a single day.
Another solution that could work is as explained:
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
But as noted this does not open the draft on the first time you go there. It seems you have to travel to that link 2 times in a row to get the message to appear. I guess you could go to the page maybe inject some javascript to go to the page again but I don't know how to do that.

WebRequest Redirect to Interstatial shows blocked by extension instead of the local resource. Not 100% reproducable

I have an extension that has been working for almost 2 years now with out issue. I havent made any changes in about a year, but recently i started seeing some change in behavior.
I use the Webrequest APi to intercept navigations. During the callback for some websites i need to do some security evaluations async. When this happens I redirect to a local resource (html) as an interstatial page that tells the user what I am doing. Once complete based off the evaualtion the page is redirected where it should be. This is ussually very fast and has worked great for the last 2 years. Since the latest version of chrome things dont seem to work anymore for all cases.
If i intercept an address bar navigation. everything works as expected. The interstatial pops and everythings great. However. If i click on the same website as a link on a webpage. I get the "Blocked by Extension page". (what you would get if the nav was cancelled). I also noticed that my interstatial is showing up in the web history and if i click on it from my history page everything works.
It seems as if a bug might have been introduced by google?
Just wondering if anyone has seen this.
Thanks

Is it possible that InBox Actions are being used to phish Amazon customers?

I've just encountered some weird behavior in Gmail that looks like some new kind of phishing attack. I got a couple shipment confirmations from Amazon today and there are these "Track Package" buttons (also I see "View Order" buttons on order confirmations) but when I click on them the page that gets opened is clearly not the correct shipper's web site.
Which looks fine but clicking on those buttons lead to bad pages. For example one of them goes to http://websro.correios.com.br. On the other it goes to USPS.com while the actual shipper (and correct link in the email body) goes to UPS.com.
I've looked at the source of the email and it all looks fine. There are no SCRIPT tags of any kind and no bogus links anywhere in the text (by which I also mean the HTML). The problem appears the same in Safari (6.1.1) and Chrome (31.0.1650.63). It looks normal in Mail (both Mountain Lion and iOS 5).
I couldn't figure out how such a button could get there and I found this feature for adding "registered" script actions to Gmail which is the only thing I can imagine would affect both Safari and Chrome.
When an order confirmation or parcel delivery email doesn't contain the necessary microdata to trigger the action, Gmail can still try to automatically extract the same information and show the button to the user as if the microdata was present.
Clearly this approach is less accurate than the one that relies on microdata, and it seems that in your case something went wrong with the automatic parsing.
No need to be worried about phishing though, as actions only show up for registered senders.

LIKES done by me on my own page don't show up anymore after making an app to post to my page's fanpage

I really hope someone can tell me more about what's going on, because I spent days searching the net and for the life of me can't say what is going on.
Here's what happened. I have a website 4nieuws.nl . On every article's page I put a like button using the Javascript SDK. All worked well. On facebook I created a fanpage for the website, facebook.com/4nieuws and every now and again I would copy an interesting article there. The like button and Javascript SDK on 4nieuws.nl uses the APP Id from an app I created specifically for that purpose.
Then I thought I might automate to publish the most popular articles on the fanpage using the PHP api. I set about getting the proper authorization key using the sequence explained on this page: http://www.typeoneerror.com/articles/post/permanent-facebook-sessions-and-posting-as-a-page
For this to work I authorized the previously mentioned app to publish on the facebook fanpages that I am admin of. And this works.
Now for the strange part. Ever since I authorized the app, if I go to 4nieuws.nl and like a page, or even 'post to facebook', the button shows 1 more like. But the like message never shows up on my personal wall. My wife, logged in to her own facebook account, gets a notification that I liked a page, but when she clicks the notification she is sent to a Facebook 404 page. When I subsequently reload the article, my 'like' is not there anymore.
Has anyone ever come across something like this ? I'm a bit anxious because I am not sure if other peoples likes on 4nieuws.nl are working as it should. I do see likes on pages but have no idea if those likes are actually registering on peoples walls.
Any help greatly appreciated.

Like button aren't connecting to Facebook Feed after DNS change with website re-design

So I just launched a re-designed website on a new server. It's been 48 hours since the site migration from the old server to the new server. I just added Like buttons to news entries and for some reason they're not showing up on a users wall when clicked on. If a comment is entered in the drop down (after clicking Like) and the Post to Facebook button is clicked, then the comment shows with a URL to the page--no title, no description text, etc. The only thing I can think is that Facebook for some reason has the old website DNS cached which of course would lead to unavailable URLs.
Anybody experienced this? Normally Like buttons are super simple to implement, but these one are being stubborn.
Either Facebook DNS hasn't propagated or their cache is old.
You can clear FB's cache by putting in your url in here: http://developers.facebook.com/tools/debug

Resources