I hope this question doesn't get closed. I am having a real issue with real traffic where bots or automatic browsers are hitting my site.
Is there any one who tried checking " no script" tag in detail. Will this "no script" tag can execute or pull a link that I have specified through a link element or an img src element if javascript is disabled.
Problem that I have here is this... I have visitors to my website and I am trying to track users which comes with browser but with javascript not enabled.
I added iframe, img, link tags inside "no script" tag to track users without javascript so that it will add a log for me when no-js users visit the page. But looks like "no script" doesn't get executed.
I can only add iframe or js elements and I can't add server side scripts to track these users.
I have tried adding no script tag in body element with a tag like this.
<noscript><img src=example.com/log></noscript>
<noscript><link src=example.com/log></noscript>
<noscript><iframe src=example.com/log></noscript>
This gets triggered when I run this from Mozilla with js disabled. But when real traffic is hitting my site, this no script tag doesn't get executed. basically I am trying to figure out the visitors who is coming with a browser enabled but somehow the no script tag is not getting executed.
Installing something server side is something that I can't do. I need to have some script like js script similar to google analytics to track this. I was thinking, if I add a log in no script tag that will get executed when no js users hit my site.
google analystics also recommends adding an img src for "non js" users in no-script tag. But when I tested with real traffic to my site, these users are not getting tracked.
Any help on this is much appreciated.
Thanks Lynn
Related
Hi I am trying to embed GPT (Google Publishing Tags) adverts into my web application (which work fine). However I have been asked to ensure that the client can edit and amend the GPT HTML scriptlets reviewing there changes prior to sending there changes live. My problem is that when I reinsert the amended advertising HTML and Scripts back into the DOM (for review) the advert scripts no longer are able to be executed by the browser (javascript error).
Hi I have tried looking through the following sites for help: https://support.google.com/admanager#topic=7505988
As well as trying various things mentioned in the GPT API reference such as destroySlots option for example so I can reset the googletag javascript object to reinsert the script
https://developers.google.com/doubleclick-gpt/reference
Please review this minimal reproducible example of what I want to achieve:
https://codepen.io/angusgrant/pen/eawbLV
Click on 'Edit Advert' button (A dialog window should open with a textarea input showing a HTML textarea input with the HTML source of the advert script shown.
Click on 'Preview' button. Note that the GPT advert no longer is displayed / rendered.
This is the HTML (scriptlet) I am loading on page load and need to be able to reinsert back into the DOM via JS:
<div id="addSlot1" style="height:600px; width:160px;">
<script>
googletag.cmd.push(function()
{
googletag.defineSlot('/1008130/Wide_Skyscrape', [160, 600], 'addSlot1')
.addService(googletag.pubads())
.setTargeting("Pub_code", "asnr");
googletag.enableServices();
googletag.display('addSlot1');
});
</script>
</div>
I expect the advert to be (still) displayed (with any amendment to the HTML made in the textarea being rendered in the web page as well).
What I actually experience is that the advert code gets loaded into the DOM as expected (with exactly the same HTML/ Javascript code) and the browser tries to render changes but I get an error in the developer tools:
Exception in queued GPT command TypeError: Cannot read property 'addService' of null
and the advert no longer renders.
Please advise how I re-write the GPT HTML / scriptlet so it runs on page load and when reinserted back into the DOM ?
I'm going through some legacy code with a lot of tag manager tags in it. Is there a way to tell which tag is applied in the page from the code or the page itself?
Activate the preview mode in GTM, it will show a panel in your browser that tells you which tag has been fired under what condition.
Else install Ghostery and use it to block GTM. What remains are tags inside the page itself.
If the page you are looking for is not yours, you could look into this file: http://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX . Here are the fired tags visible.
Another way is installing the Google Tag Assistant for Google Chrome. You can find all Google tags that are fired on the page from multiple GTM containers.
Okay so I'm a google analytics & js noob so I know the absolute basics.
On my site http://www.wildseasonthegame.com I have some humble bundle widgets which are Iframes.
I'm still trying to understand analytics but as I understand it Theoretically I should be having a code like this
something goes here
Now my question is =
Can I replace href with iframe and will it just work? Or will i need to do other stuff (like add some extra JS) to make it work, seeing as how iframes are funny little things
Or do I wrap each iframe in its own a href with a # destination and track conversions that way?
HOw do i differentiate between clicks made to input their email and clicks to purchase?
Any other suggestions how I can track the conversion offsite. Humble bundle has an off site thank you page, but It doesnt look like it redirects back to myne, let alone guarantee tha tpeople will arrive at my page instead of closing their browser after the transaction.
If content is iFramed in you're unfortunately going to have a hard time getting any tracking on it thanks to the same-domain policy. The best way would be to add tracking code to the pages iFrame'd in... but good luck getting Humble Bundle to add your code to their pages. You can get some click tracking on it, but it'd literally just be clicks anywhere on the iFrame.
There is a webpage i am making a greasmonkey script for. This page has several iframes. I have found out that they are the problem, however i do not know how to solve the issue.
At first my script creates a small div box with the button. By pressing a button script analyzes webpage contents and calls alert on certain conditions.
Javascript console in Firefox already shouts to me that access was denied for document because my script is using document.getElementByID to find the top document's body, where the div box is being appended to.
This is easily avoidable problem as then script fails and gets stuck in iframes, yet it still continues on the main page as it does give the access to document.
The problem araises when i try to use alert in my function. Seems like iframes take over my script and kills it with the Permission denied to access property 'alert'.
How do i tell browser/script or whatever, that i only want my script to run on main document and i do not want to be bothered by iframes?I installed NO-script addon, allowed the primary domain and blocked the secondary domain (that loads inside iframes) and all the alert messages go normal. But, i can't ask my users to install noscript enable/disable specific domains and my script should be working fine. I need to find solution which would work with all the iframes enabled.
Hope it didn't sound confusing.
Thank you for any help.
RE:
How do i tell browser/script or whatever, that i only want my script to run on main document and i do not want to be bothered by iframes?I installed NO-script addon, allowed the primary domain and blocked the secondary domain (that loads inside iframes) and all the alert messages go normal.
First, adjust your include and exclude directives to ignore the iframes as much as possible. EG:
// #include http://example.com/normal/*
// #include http://example.com/extra/*
// #exclude http://example.com/extra/in_iframe/*
Next, add these 2 lines as the first lines of code after the Metadata Block:
if (window.top != window.self) //-- Don't run on frames or iframes
return;
That will stop the GM script from running on iframes.
I don't want to deal with users who have javascript turned off, so I want to just prevent them from using my application. I want to detect if the user has javascript turned on so I can redirect them to a page that tells them they need to use javascript. I'm sure its in the request header. Anyone have any ideas how I can do this?
The noscript tag is the easiest solution, though not exactly whay you're looking for.
<noscript>Get outta here.</noscript>
Do you really need a redirect at all? Put the message in a <noscript> element, and it will only be displayed to those it applies to.
You can't. The server has no idea what the client has enabled. You can't even "detect" if Javascript is disabled from the client (because what would you use to do so?).
You can use tricks to show content when Javascript is disabled (for instance, a <noscript> tag, or using Javascript to hide content that is meant for JS-only).
There is no way to detect JavaScript on the server side. However, you can use a NOSCRIPT tag to display a message indicating that your website requires JavaScript.
For an example, turn JavaScript off in your browser and load a Stack Overflow page. There'll be an obnoxious red message across the top of the page warning you that the site works best with JavaScript enabled. You can examine the Stack Overflow source code and CSS styling to see how they implemented it.
If you really want to deter non-JavaScript users from using your website, you could put your message in a div inside the noscript tag and expand the div to cover everything on the page.
You only need html:
<noscript><meta http-equiv="refresh" content="0;url=http://example.com/use_js.html" /></noscript>
This of course won't prevent the server from serving content, it only will output this meta refresh tag, which will be parsed (and executed by redirecting the user) by clients that got no javascript or javascript disabled.
You could have a landing page with a snippet of javascript that runs and redirects to the real railsy landing page, or perform an AJAXY call to get the data you want to show the user. This would positively require javascript to be enabled to continue.