July 12, 2011

Track social interactions as events for the google +1 button

Google Analytics released recently the _trackSocial  for Google Analytics. It was part of a bigger release on several Social applications including Google+. Sometimes things have to be pushed out before they're extensively tested, and a couple of bugs may come up.

With the social Tracking one specific bug bit me the other day. Google Analytics won't apply hostname filter's to the social interactions, and it may cause profiles that are filtered to only include traffic to domain A, showing social interactions for domain B. From there all sorts of bad things follow: 0 pageview visits, lower pages/visit and so on.

At first I thought about disabling the socialTracking on the +1 buttons, but it seems that the API don't support it yet. But I found an undocumented feature to disable it. Now you can disable the socialtracking on the +1 button and use Events instead, since they go through the filters before showing up in your Google Analytics profile.



You'll only want to use it if you are having problems with social tracking and hostnames filter. Otherwise the default behavior is way better since it will populate in separate Social reports.

Update


If you are using the asynchronous code for Google +1 button, loading the syntax is a little bit different.



Thanks Fábio Phms.

May 19, 2011

Cleaning up files with eval(base64 Malware

This blog was recently infected with a eval(base64 malware. This kind of malware use site vulnerabilities to inject a long list of link in the beginning of pages so it theoretically improves those site's SEO performance.

This kind of strategy is just sad, telling from the perspective of an SEO.

I came up with a nice oneliner to clear all that nasty code. Works great for me. May be useful for others.


find . -name "*.php" -print0 | \
xargs -0 -n 1 grep -l -Z eval.*base64 | \
xargs -0 -n 1 sed -i'.old' '/eval.*base64/ d'