Bug in external link tracking when opening the link in a new window in Google Analytics? - popup

First off, I apologize if it's considered poor etiquette to cross-post on stackexchange sites, but this seemed appropriate for both the webmasters site and here, as it's a common issue for webmaster, but may be able to be solved by coders. In any case, here goes...
OK, so this seems like a really simple problem, but I have yet to find a solution that accomplishes the following:
Opens the link in a new window
Tracks the event in GA when using the asynchronous code
Doesn't trigger pop-up blockers (uses target="_blank" instead of window.open)
Most of the code I've seen, including Google's, doesn't take into account the case of opening in a new window - they just use window location.href.
Even GAAddons (http://gaaddons.com/), which charges for commercial use, seems to not manage opening in new windows properly.
Perhaps, I'm missing something simple - I'd be relieved if so and would thank profusely whoever points it out to me!
If no one is able to provide an example, I'll post some of the test cases I've created to illustrate the problem.
Thanks.
[EDIT] I've since tested the GAAddons code more throughly and have found it to work. I'm guessing the problem that was being reported earlier by a client using Chrome 7 on Windows was more likely a configuration issue than something related to the GAAddons library itself.

You put it in the link's onclick attribute:
some link

The method I've found to satisfy all the requirements I've mentioned is the one found here:
http://cutfromthenorth.com/add-external-link-tracking-with-jquery-and-google-analytics/
It's actually quite simple, leading me to think that there was some other reason why other code wasn't working in earlier tests.
However, I can confirm that the method that's mentioned in the comments on this Google page - http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55527 - does not meet the above requirements (new windows trigger popup warning on Chrome and IE).
The Google code does work for tracking external links not opened in a new window.
here's the snippet:
$('a[target=_blank]').click(function(){
try{
_gaq.push(['_trackEvent', 'External Links', 'Click', $(this).attr('href')]);
} catch(err) {}
return true;
});
I've tested on the following browsers:
PC:
IE 6 - 9
Firefox 3.6, 4.0
Chrome 9, 10
Safari 5
Opera 11
Mac:
Safari 5
Chrome 10
Firefox 3.6, 4.0
Also tested on iPhone 4 and the native Android browser on Gingerbread

Related

Why barcode scanner opens Chrome developer console in chrome?

I just bought a barcode reader from China model Honeywell HH400. It works perfectly when I use it other device. But now I use it in my web application and I am getting a problem. It always toggle Chrome developer console. I also tried scanning barcode into URL bar, and it does the same. Does it have an event to trigger F12 what? Or misconfiguration with the scanner that I don't know?
I am sure that you might have already received a solution.
But for others who might come across this issue,
I ran into this problem today and found that no matter what prefix or suffix I try, on every browser it emulates pressing F12 which opens the browser console.
The same barcode functioned as required a couple of weeks ago.
Every barcode comes with a quick start guide that you can use to set prefix suffix etc.
There is also a bar code that "Recalls Defaults". Just scan that and you should have the factory defaults set.
This resolved my issue.
Hope it helps someone.
For me the solution was to remove the "Line Feed" suffix ( which was not removed when I scanned the "remove all suffixes" code ), as the line feed is interpreted as CRTL-J on windows machines ... no idea why !?
( no time to research it either ;)

Ionic: Disqus embed loads locally, but not in production (or on an emulator)

I've built a simple Android app, as a companion piece to a publication website, with the Ionic framework, and (after much head-banging), I managed to get the Disqus threads on the app to sync with those on the site. After trying a few different methods, I ended up going with this directive from Michael Bromley to implement the Disqus widget in the app, which is hiding behind a "Comments" button at the bottom of each article on the app's UI.
Running with Ionic Serve, everything works brilliantly. Outside of the local server: not so much. I don't get an error message from Disqus – it simply doesn't load the iframe at all. I'm refraining from posting code, because I'm wondering if this is simply a CORS issue, or maybe something simple that I'm overlooking.
One thing that might be of importance: I don't have the Crosswalk plugin installed on the app – I'm not sure if my thinking is correct, here, but could it be possible that Disqus is compatible with Chrome, which is why it runs fine when I'm testing it on my browser, but isn't compatible with Android's default browser? I'm not extremely well-read on Crosswalk, but I believe it tells the app to use a specific browser – if so, could installing it fix the problem? I'd go ahead and install it, and see if it helps, but I'd like to avoid tampering too much with an otherwise-working app if the issue is something completely unrelated to the plugins.
One weird caveat: The Disqus comments loaded on one article just fine when I tested the app on Genymotion. I deleted that article, and created a new Test article on my site (thus firing up a new Disqus thread), and that failed to render on Genymotion. It seems very... random, I guess, that it would work once. It would seem that it would either work all the time, or never work.
EDIT: While running on Genymotion, no errors appear in the console when debugging the app with WebView. The fact that I'm not getting a "Refused to load" error makes me think that Disqus is getting called and, for whatever reason, is refusing to answer the phone at all.
I can spend hours trying to figure something out, and then... well, as soon as I post a question, I end up figuring out the answer five minutes later.
I dug looked into the code for the directive I was using (which I highly recommend for anybody looking to easily implement Disqus into any AngularJS project), and I noticed that was calling for embed.js with the following string:
....
if (!$window.DISQUS) {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
} else {
....
Amending dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';to add a protocol, making it dsq.src = 'http://' + scope.config.disqus_shortname + '.disqus.com/embed.js';fixed the issue on Genymotion. I'll ship the updated APK to the Play Store, and comment on this answer to confirm whether or not it holds up there, as well.

Facebook SDK for .NET - Security Warning Issue

everyone. Today I encounter the following message in my Windows Phone App:
Success
SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.
This happens when my users Login through the Web Browser Control, which get the Login URL from the GetLoginUrl method from the Facebook SDK for .net. This problem is not only happening in my Apps, I've seen users from other Apps having the same problem.
Anyone found a solution to this?
I'm running this SDK in my PictureWeather (Windows Phone 7 & Windows Phone 8) and Picture2Cams (Windows Phone 8) Apps.
Had the same problem. In my app I changed this line:
parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
To this line:
parameters["redirect_uri"] = "https://m.facebook.com/connect/login_success.html";
And it works now.
Had the same problem on our WP8 app using the Facebook SDK for Windows Phone (http://facebooksdk.net/docs/phone/) and the indicated solution with changing the redirect URL also worked for us.
Thanks for submitting this solution.
I ran into this problem, myself, and did a bit of digging to get to the root of the issue. The problem seems to spring from some unknown (to me, anyway) change on Facebook's side, where previously the authentication response URL was in the form
https://www.facebook.com/connect/login_success.html#access_token= ...
for some reason it now comes back from the login flow as
https://www.facebook.com/connect/login_success.html#?access_token= ...
The code in FacebookSDK.NET does a comparison in line 104 of LoginPage.xaml.cs with a simple Uri equality test
if (e.Uri == WebAuthenticationBroker.EndUri)
which fails to return true when the question mark appears in the middle. I expect Facebook will correct this on their end just because too much stuff breaks, but in the meantime a pretty clean fix is to get the FacebookClient sources from GIT instead of NuGet and change the comparison to this
UriBuilder clean = new UriBuilder(e.Uri);
clean.Query = "";
if (clean.Uri == WebAuthenticationBroker.EndUri)
The code will then run just fine, but this is seems ultimately to be Facebook's bug when checking the documentation on their developer site.
I hope this helps some others, I signed up for Stackoverflow just to make this post. :)
Use latest facebook sdk for windows phone. This issue got resolved in latest sdk. I am using Facebook.Client 0.8.2-alpha and its working great. I followed http://nuget.org/packages/Facebook.Client and http://facebooksdk.net/docs/phone/controls/login-ui-control
I guess the only way he did this was by downloading both projects from their official Github (Facebook and Facebook.Client) and reference them in your app instead of using the DLL that you can get from Nuget.
With both projects in hand, you can change this parameters on the Facebook.Client Project in the file FacebookSessionClient. Then build all the project and run.
However this solution didnt work for me too.

window.CavalryLogger error in Facebook App running in Facebook Page Tab

I have applications which are displayed as tabs in Facebook pages which have been working fine. They suddenly started displaying this output in the tab:
/1336720089,176820405/
if (window.CavalryLogger) { CavalryLogger.start_js(["EgxV3"]); }
__d("UFIUpdate",
Any ideas what is going on???
Here is a link to one of them: http://www.facebook.com/TweakShoes/app_132692060112327
A temporary solution is to add https:// to facebook itself. This doesn't solve the problem, but it'll allow you to see your page on a per client basis.
The best fix in the longer term until facebook fixes this issue is to go to your account settings > Security > Enable secure browsing. This will enforce HTTPS wherever it can and should resolve the issue for a lot of pages you're trying to access.
Good Luck!
After encountering this issue yesterday, I tracked it down to an apparent conflict with the JS log wrapper included as part of HTML5 Boilerplate's script.js file. In particular, the "make it safe to use console.log always" snippet. After commenting it out, the FB lib error went away and my app displayed properly.
I didn't dig into what the conflict was, but here is the snippet. If you use something similar on your page, then it may be worth investigating.
/* make it safe to use console.log always */
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());
It's probably not a coincidence that FB's own logger bugs out with this.
Facebook has opened a bug for this issue and recently triaged it to medium priority - no word on when it will be addressed.

tinymce displays raw html code and no Buttons for one user in IE7 , 4 others users have not problems. If that user uses Foxfire it works perfectly

I have 5 users (3 locations) using the pages that have Tiny_MCE text areas.
I receive No Errors and it works Perfectly on the other 4 machines running IE7 This would indicate there is No JavaScript Errors.
One user only is seeing the raw html code and no buttons at all.
I suspect it must be some IE setting that is wrong.
It does not appear that Javascript is disabled, as other Javascript functions work on that same site on the same machine in IE.
This user is running XP Pro, and IE 7.
When I installed FireFox on his machine, the Tiny_MCE works perfectly. This would Also indicate there is No JavaScript Errors.
I'm at a loss to explain it.
Any Ideas would be appreciated.
Thanks
Once I ran into same issue and the fix was to remove a comma at the end of the script. So check whether the error pattern is present in your code.
For example, the following code contains a bug which will prevent it from running in IE7.
tinyMCE.init({
// General options
mode: "textareas",
theme: "advanced",
...
template_replace_values: {
username: "Some User",
staffid: "991234"
}, // <<< BUG - Additional comma here
});
If you can enable javascript debugging in IE7 then post the js error here.
Funny thing. The problem fixed itself with no human assistance. No Reboot, No Nothing. after being AFU for 2 weeks, it just started working again.
Got to Love Windows!
I've encountered this before and it has always been a caching issue. Use Ctrl-F5 in IE to force a full refresh of the page and all its files (*.css, *.js) in the browser and the browser cache. My guess is the IE 7 computer that was bad had a 14 day setting for checking if files were up to date.
Sometimes it's been worse - the web server (tomcat 5.5) would cache the file too and not notice the file was updated. Restarting the web server fixed that.
We are experiencing the same problem with our software last few months.
I found this forum topic on developer's website:
http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=66594
In short words, he is recommending to set strict_loading_mode to true when initializing tinymce. I've done that, and since that i had no problems.