Google Ads in Electron? - javascript

I'm writing an Electron app that I'd like to place Google ads in, but I'm not sure how to correctly do it.
I've created my ad snippet and put it in my app. The default snippet uses //googleads.g.doubleclick.net ... as the URL for the adsbygoogle.js file, so I had to change that to https://googleads.g.doubleclick.net ... because the Electron app uses file:/// to load the index page.
But after doing that, the adsbygoogle.js file throws up a 400 error which is strange.
And on top of that, I'm not sure how to handle a user clicking on ads. To get the link to my website working, I had to create a link that pointed to javascript:shell.openExternal('https://example.com'), but I'm not sure how to do that with external ads.
So how can I put ads in my Electron app?

Google AdSense is not allowed in any desktop applications.
From AdSense policy:
Google ads, search boxes or search results may not be:
Integrated into a software application of any kind, including toolbars.
Displayed in pop-ups or pop-unders.
Placed in emails, email programs, or chat programs.
Obscured by elements on a page.
Placed on any non-content-based page. (Does not apply to AdSense for search or mobile AdSense for search.)
Placed on pages published specifically for the purpose of showing ads.
Placed on pages whose content or URL could confuse users into thinking it is associated with Google due to the misuse of logos,
trademarks or other brand features.
Placed on, within or alongside other Google products or services in a manner that violates the policies of that product or service.

I don't sure about Electron but Node Webkit (very similar technology) allows creation app from any given url.
So, you can actually host your app in the web (with running AdSense ads on it) and create installation package for Node Webkit app.
When installed it will be just regular browser showing by default your web app (with AdSense).
There is no way (IMHO) to Google to distinct Chromium browser downloaded from your site or Download.com to same Chromium browser downloaded from google.com.

I think you can do some Iframe html tag and display your website with the ads in it !
but idk if this is count as a view.

Related

What is causing the site to call Facebook for scripts and images?

We have a ASP.NET MVC website that contains no JavaScript file or image referenced from Facebook.net or Facebook.com.
Yet Firefox developer tools is showing these calls are happening and causing the site to load slowly.
How do I find out what is causing these calls?
These kind of transactions are usually connected to Facebook Like/Share/Follow buttons (Facebook plugins in general) embedded in the webpage.
Based on the few transactions, which you shared, I would say that you've added a Facebook Page/Group Plugin to your webpage.
It was coming from Google Tag Manager JavaScript code. Even though there were no hard coded references to Facebook in the project, they were present in the Google Tag Manager admin console.

Google Analytics: Do I need URL address?

I am a complete Google Analytics beginner and would appreciate a help with a basic question.
I am developing HTML, CSS and JavaScript based applications which are further uploaded into an iOS application to present your applications in a fancy way. Therefore my application is a hybrid application (half JS web site, half mobile app).
I would love to see users' activity in my app when they are browsing through it and I thought GA might work well with it - but the problem is, that the outer app doesn't provide me with any URL of my inner JS app (the inner web site's URL is file:///).
At this page (link), I found that URL is not really important, that it is the tracking code which is important. So I used a dummy URL, added the GA snippet into my application and uploaded it in iPresent. I can't see no live activity though... :/ It also says the measuring is not installed (not used at a home page).
So I am wondering - is the URL really important?
Any ideas?
Thanks!
URL (or page path) is only important if you want to report on data based on which URLs your visitors went to.
If you app doesn't use URLs at all, perhaps it fits better with the "app" model where you are sending screen name data instead of page data. You can read more about the differences between web and app views here:
https://support.google.com/analytics/answer/2649553
I found out that URL is not needed. This type of problem can be solved by using GA Measurement Tool
https://developers.google.com/analytics/devguides/collection/protocol/v1/
Validate your hit here:
https://ga-dev-tools.appspot.com/hit-builder/

How can you get Smaato ads to open in system Browser when building mobile apps in Monaca?

I've got a couple apps that I want to place ads in. I've tried using a couple different ad platforms but have decided on Smaato (inmobi was my first choice, but I've not had any success with my getting account activated). Smaato integrates well and it works, however it's js (hosted on their site) has the links opening with target="_blank". This would be great if I was using this on a website instead of an app, however all this does on my app is open it in the inapp browser. I tried downloading a local copy of the js and changing the function to build with target="_system" instead, but this breaks it somehow.
If anyone has done anything similar to this please let me know what you did to get it working.
Thank you

How to develop a Bigcommerce app that would add a javascript tag to all pages in the store?

I would like to develop an app for Bigcommerce that other users of the platform could use. The app should add a simple javascript embed code to all pages of the store. The embed code is similar in nature to google analytics embed or chat services embed codes.
I have opened up a trial account with Bigcommerce and found out that it is very easy to manually edit the page templates to add such an embed code, but I would like to be able to develop an app that store owners could install and not have to mess with editing and copy-pasting embed codes into their page templates.
Unfortunately there is no mechanism currently for BigCommerce that allows for the editing of template code via the app.
I can give you pointers as to where you can put your code to make it globally available.
If you need something in the <head> globally: /Panels/HTMLHead.html
If you need something at the beginning, right after the <body>: /Panel/DrawerMenu.html
If you need something at the end, right before the </body>: /Panels/Footer.html
These are the 3 common places most javascript things (like tracking pixels and analytics) usually go.
Other "extensions" for BigCommerce, such as OLark and Zendesk and Analytics, all just give either a web page with instructions, or a PDF with installation instructions. You could provide your functionality via the same means in lieu of an app doing it.
I haven't really worked with Bigcommerce, but I went thorough their docs and it looks like there is no option for custom module that you can upload and use on their server. And that makes perfect sense.
So I would say the only "forth to try" option is to build browser extension, that does the job for you. As I understood, you can control html output of your store by choosing "Themes" tab > "Edit HTML/CSS", so extension should be able to walk through the three of pages in the left panel.
Chrome Extension
Firefox extension

Twitter Cards using Backbone's HTML5 History

I'm working on a web app which uses Backbone's HTML5 History option. In order to avoid having to code everything on the client and on the server, I'm using this method to route every request to index.html
I was wondering if there is a way to get Twitter Cards to work with this setup, as currently it can't read the page as everything is loaded in dynamically with Javascript.
I was thinking about using User Agents to detect whether it's the TwitterBot, and if it is, serving a static version of the page with the required meta-tags. Would this work?
Thanks.
Yes.
At one job we did this for all the SEO/search/facebook stuff etc.
We would sniff the user-agent, and if it was one of the following sniffers
Facebook Open Graph
Google
Bing
Twitter
Yandex
(a few others I can't remember)
we would redirect to a special page that was written to dump all the relevant data about the page for SEO purposes into a nicely formatted (but completely unstyled) page.
This allowed us to retain our google index position and proper facebook sharing even though our site was a total single-page app in backbone.
Yes, serving a specific page for Twitterbot with the right meta data markup will work.
You can test your results while developing using the card's preview tool.
https://dev.twitter.com/docs/cards/preview (with your static URL or just the tags).

Categories

Resources