Google Analytics code is on my site, but invisible - javascript

On my website ( https://www.smilinggardener.com/ ), the Google Analytics tracking code isn't visible in the page source code, and Google Search Console can't see it in order to verify my site.
Yet the Google Tag Assistant says it's there, and when I run developer tools and go to 'network', I see the analytics.js file is loaded, and most important, it is tracking visitors.
Any ideas what could be going on?

The analytics code is loaded via an external file.
If you look at your network tab in Chrome there is a column "initiator" (if it isn't there by default you can enable it by clicking the table header and check the respective option). The initiator is the file (if any) that triggered an external dependency.
That in your case the filename contains a complicated id suggests that it is dynamically created by some extension in your CMS.

Related

Integrating GA in chrome extension, manifest v3

I need to integrate GA into my chrome extension, using manifest v3. it looks like I miss something, but I can't figure out what exactly I'm doing wrong.
My extension has only a content script and background.js where I'm listening on events, to execute content.js when the user clicks on the Icon, in the extension toolbar. Content script by himself injects widget UI into websites, where users can interact with. And I need to track click events.
And in terms of manifest v3 enter link description here, I need to use protect GA scripts like
"content_security_policy": {
"extension_pages": "script-src 'self' https://www.google-analytics.com/analytics.js"
},
But when I try to refresh my extension on chrome://extansions page, it throwing me a popup with a failed status
Maybe someone has any ideas on how to solve this problem?
I was able to do this by embedding the analytics.js file into my extension.
Then the ga function would be availabe in the window scope window.ga on the content scripts.
You are trying to use the analytics embedding documentation and request a script at "https://www.google-analytics.com/analytics.js ". But according to this document, for extensions you should use the following version: "https://ssl.google-analytics.com/ga.js". (and update manifest accordingly)
In the given document you can find more detailed information on the implementation of Google analytics in the extension:
https://developer.chrome.com/docs/extensions/mv3/tut_analytics/
Important clarification:
Even if you correct everything according to this official documentation, you will probably get a manifest filling error. I have not found a solution to this problem and, in general, it seems that it is impossible to connect Google analytics to the extension with version 3 of the manifest (this is inaccurate)

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.

Can you use a Google Docs Script in conjunction with a Google Chrome Extension to insert text into the body of a Google Doc?

I would like to have a Chrome Extension interact with the contents of a Google Doc - specifically to add text and ideally html to a document with the click of a button in the Extension popup.
I've read that a Google Extension can 'talk' to a Google Docs Script - to gain access to the script model and its commands.
Can you hand off a string from a Chrome Extension and have a Google Docs Script take that string and then insert it into the document (at the cursor location, for instance)?
Would the user have to manually approve the script each time it was called? Or just installed once and then the process runs in the background?
A commenter gave a very helpful link to a similar need and solution for Google Sheets. But that solution (see comments below) depends on Google Sheets APis and there does not seem to be an equivalent Google Docs API.

Google Ads in Electron?

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.

Taking a screen shot from the console window to check if google tag manager has fired or not

To check if the google tag manager has fired or not I usually go to the web console and take a look at the output which shows if GTM has fired or not. I first need to go to google tag manager preview view, and then put in the url (which I need to check for gtm) in the address bar and later have a look at the web console which says if the gtm for that particular URL has got fired or not. Since this is quite time taking, I would like to automate this process by taking a snapshot of the output in the web console. Could any body please advice as to how this can be done. I thought of doing it via Phantom JS, but then wasn't sure how, because there are two things involved - (1) First, we need to go to google tag manager preview view and then key in the URL in the address bar (2) I need the snapshot of the output in the console window.
Please advice how I can go about doing this and if automation is actually possible.
try Google Tag Assistant, from the Chrome App Store. It's a decent tool which helps a lot with troubleshooting and validating Google tags such as Adwords, Tag Manager, Analytics, etc.
https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en
It offers tips how to fix issues and verifies when tags fire correctly. Enjoy!
May be you can use selenium browser testing

Categories

Resources