Online Book Reader

Home Category

Facebook Cookbook - Jay Goldman [94]

By Root 655 0
can read all about the new tracking code on the excellent Analytics Talk blog, maintained by Justin Cutroni: http://www.epikone.com/blog/2007/10/16/gajs-new-google-analytics-tracking-code/.

Facebook exposes the urchinTracker object to you via FBJS, so you can explicitly record some actions within your app:

Most Analytics users will be happy with this, but if you’re the type who likes to really get under the hood and do things with the stuff, you can pass in a wide variety of Urchin Traffic Monitor settings to tweak the performance; see Table 6-21.

Table 6-21. Parameters for fb:google-analytics

Name

Type

Default value

Description

page

string

N/A

The argument given to the urchinTracker() function, either a page or a virtual page.

ufsc

bool

1

Turns the client info flag on ( 1) or off (0).

udn

string

auto

Domain name for cookies. Can be auto, none, or domain.

uhash

string

on

Turns the unique domain hash for cookies on or off.

utimeout

int

1800

Inactive session timeout in seconds.

ugifpath

string

/__utm.gif

Path to the __utm.gif file.

utsp

string

|

Transaction field separator.

uflash

bool

1

Turns the Flash version detection option on ( 1) or off (0).

utitle

bool

1

Turns the document title detection option on ( 1) or off (0).

ulink

bool

0

Turns the linker functionality on ( 1) or off (0).

uanchor

bool

0

Controls whether the use of anchors for campaigns is on ( 1) or off (0).

utcp

string

/

Cookie path for tracking.

usample

int

100

Sampling percentage of visitors to track (a whole number from 1 to 100).

uctm

bool

1

Turns the campaign-tracking module on ( 1) or off (0).

ucto

int

15768000 (6 months)

Timeout in seconds.

uccn

string

utm_campaign

Name of the campaign.

ucmd

string

utm_medium

Campaign medium. Can be one of cpc, cpm, link, email, or organic.

ucsr

string

utm_source

Campaign source.

uctr

string

utm_term

Campaign term or keyword.

ucct

string

utm_content

Campaign content.

ucid

int

utm_id

Campaign ID number.

ucno

string

utm_nooverride

Whether to override the campaign.

Translations


Problem


I’d like to be able to offer my application in other languages, but I only speak and write English.

Solution


Facebook has made their amazing Translations app available to all developers. When added to your FBML, the following family of tags represents the Translations capability on your pages:

fb:intl

Wrap content you want to make translatable in this tag.

fb:intl-token

Replaces a token contained within an fb:intl tag with its content.

fb:tag

Renders an HTML tag that has translatable attributes.

fb:tag-attribute

Contains the translatable attributes of an HTML tag specified by the enclosing fb:tag tag.

fb:tag-body

Contains the contents of an HTML tag specified by an enclosing fb:tag.

fb:date

Renders a locale-specific date based on the settings of the viewing user.

fb:fbml-attribute

Contains and makes translatable the value of an attribute of an FBML tag.

The Translations app isn’t intended to provide translations for user-generated content within your application (which you hopefully have if you’ve built a good Facebook app), but rather for all of your static text (application description, About Page content, etc.), FBML content, Notifications, requests, and Feed stories.

Using the tags is quite simple and will become second nature as you write new FBML. Assuming you haven’t built a gargantuan app with hundreds of pages, you should be able to go back and retrofit the Translations tags fairly quickly. As an example, consider this FBML:

Share a Pan Galactic Gargle Blaster with ?

You could make it translatable by adding a few tags:

Share a {drink} with ?

Pan Galactic Gargle Blaster

Return Main Page Previous Page Next Page

®Online Book Reader