Free Behavioral Targeting and Segmentation - BTBuckets

Phillip Klien

Bringing Facebook Connect demographic data to Google Analytics via BTBuckets

I have been fooling around with some possibilities of using demographic data from Facebook Connect integrated with BTBuckets - and one immediate advantage is the ability to understand user behavior based on this data. Demographic data in your webanalytics platform.

So, if you use the Facebook Connect + Google Analytics + BTBuckets combo - I created a targeting code that allows you to automatically feed Google Analytics with the demographic segments brought from Facebook Connect.

Now you can see information such as gender or age distribution for specific sources and/or content. Check out the custom report below where I see traffic sources for men:


How I implemented this:

1) I activated the Facebook Connect integration on the BTBuckets dashboard
2) I created a new targeting code (see code below) and selected the Facebook Male and Facebook Female buckets.


<script>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>
try {
var pageTracker = _gat._getTracker("UA-15677916-1");
if ($BTB.isUserOnBucket('fb_male'))
{
pageTracker._setCustomVar(
1,"FB_Gender","male",1
);
} else if ($BTB.isUserOnBucket('fb_female'))
{
pageTracker._setCustomVar(
1,"FB_Gender","female",1
);
}
if ($BTB.isUserOnBucket('fb_1824'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","18-24",1
);
} else if ($BTB.isUserOnBucket('fb_2534'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","25-34",1
);
} else if ($BTB.isUserOnBucket('fb_3544'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","35-44",1
);
} else if ($BTB.isUserOnBucket('fb_4554'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","45-54",1
);
} else if ($BTB.isUserOnBucket('fb_5566'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","55-66",1
);
} else if ($BTB.isUserOnBucket('fb_67'))
{
pageTracker._setCustomVar(
2,"FB_AgeGroup","67-over",1
);
}
if ($BTB.isUserOnBucket('fb_married'))
{
pageTracker._setCustomVar(
3,"FB_MaritalStatus","married",1
);
} else if ($BTB.isUserOnBucket('fb_single'))
{
pageTracker._setCustomVar(
3,"FB_MaritalStatus","single",1
);
}
pageTracker._trackEvent(
"BTBAnalytics",
"Facebook",
"Login_data"
);
} catch(err) {}
</script>

Tags: analytics, facebook, webanalytics, google, googleanalytics

Views: 373

Reply to This

Replies to This Discussion

Wow this is great. Thank you so much for sharing.

RSS

Follow us on Twitter

© 2012   Created by BTBuckets.

Badges  |  Report an Issue  |  Terms of Service