Non JS Tracker on Facebook fan page

Hello all,

I am trying to track page views of my fane page on facebook within piwik.

As Facebook does not accept JS in the FBML static page, I wanted to use the non-JS image tracker as explainded here:

However, it does not seem to work properly.
I tried various times. It seems that visits are showing up, but not always, and the URL is not recognised in Piwik, even though I mentioned the page name in action_name var.

I also tried to add “www.face*” to the site url in the config area. I don’t know if it helps or/and recommended.

Here is the code included on my fan page:

<img src="" style="border:0" alt=""/>

Facebook page url is :

The stats i can see look like this:

Can you please help me to get correct stats, including Page Name ?
I saw various posts in developer area regarding var “rec=1”. Is this function buggy ?

Thank you in advance!


Hey jOoL,

the problem is that facebook is now proxying and heavíly caching all external content for facebook pages. The IP you see is probably from the facebook bot that fetched the pixel content for caching.

You could try to send an expired header so that the pixel should be fetched on every pageview but I’m not sure if facebook will pay attention to that.


Hello Peter,

Thank you for your answer! I should have paid attention to this. I allready noticed that images are now cached. And I know that FB doesn’t pay attention to changes on original files/images once cached, even if changed, untill you save/modify the FBML tab again.

So it looks like we are stuck for tracking page views within Piwik.

There is a FBML script existing for Google Analytics.

Is there a plan to get one also for Piwik in a near future ? Are some plans with FB possible ?



jool, we would be happy to have such FBML script that would work for Piwik. If you look at the GA one, is it easy to write a similar one for Piwik?

jool, we would be happy to have such FBML script that would work for Piwik. If you look at the GA one, is it easy to write a similar one for Piwik?[/quote]
this have to be implemented by FaceBook’s team. Not by an external developper… to do so, piwik’s team have to get in touch with FB!


In there any other way? using iframe?

jool, we could contact FB if you give us all the information and prepare a message (not sure if you were interested)

Hello Mathieu,

we could contact FB if you give us all the information and prepare a message [/quote]

Actually, the request to FB, would be to develop something equivalent to the FBML tag “fb:google-analytics” defined here: or event “fb:quantcast” defined here:

This has to be adapted to piwik specific tracking api, that I personnaly don’t know enough.

But for the basics, it should be someting like the document attached [fb-piwik.pdf]


I created a ticket at: Tracking Facebook apps with Piwik · Issue #1926 · matomo-org/matomo · GitHub with summary of the issue.

May I ask which php file has the code for returning the pixel ? tried looking myself but could not find it. Want to see if there is a way to get this working as it would be an awesome feature.

matthieu / vipsoft

If you can give me some pointers on where to look in the code I would be happy to try and help to find a solution to this.


organicspider: it depends in how FB implements the GA tracker.

Look at js/piwik.js for the unminified source, and libs/PiwikTracker/ for a server-side tracker. Both send the tracking request to piwik.php.

Hey guys,

as of FB will be removing / has already removed FBML, there will be the new iFrame - Tabs where you can easily include the standard piwik tracking tag. Refering to Page Not Found - Facebook for Developers.

Thanks :slight_smile: That is great news indeed.

is FB finally doing Iframes? but how do they pass data to the frames (for example user attributes)?

any news on this ? :slight_smile: :slight_smile:
no solution yet right ?

Just add at the end a random Number same like when you use CSS FB will have to reload your track image
Same solution i use for Flash and it works inside Fb and on any wall .
What i would like to see is import of Facebook Analytik Data of your Page and Fans of the user to copare succes and viral loop adjustment .
Nice methode to mesure your Edge rank on a Page .
You Live tracker api give some nice possiblity to reflect curent online user to the User same like in livestream

Newbie here, please be gentle.

Is there a tutorial how you were able to track your Facebook fan page? I’ve read about the image tracker but I don’t know how to use it, and looking at the script, there isn’t even an image in there (<img src="http://piwik.url/piwik/piwik.php?).

So how do I generate and use it? (Include in Facebook post…etc…)

Thank you for taking the time.