When you create an ad, you have a field called "URL tags" or something like that.
It is available only for certain types of ads.
Just enter something like ad=myfirstad (or whatever you want to differenciate them)
Here's a custom code I created if you want to track it with Analytics :
<?php
if ( isset($_GET["ad"]) ){
$gga='utm_source=facebook&utm_medium='.$_GET["ad"].'&utm_campaign=facebook_ads';
echo '<script type="text/javascript">
document.location.href+="#'.$gga.'";
</script>';
} elseif ( isset($_GET["fb_source"]) ){
$gga='utm_source=facebook&utm_medium='.$_GET["fb_source"].'&utm_campaign=facebook';
echo '<script type="text/javascript">
document.location.href+="#'.$gga.'";
</script>';
}
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowAnchor', true]);
_gaq.push(['_trackPageview', '/mypage_._p_h_p']);
_gaq.push(['_trackPageLoadTime']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('h_t_t_p_s_:' == document.location.protocol ? 'h_t_t_p_s_:_/_/_ssl' : 'h_t_t_p_:_/_/_w_w_w') + '.google-analytics_._c_o_m_/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
Just customize everything in bold (also remove underscores). This code will get the "ad" parameter you passed, and transform it in order to pass it to Analytics.
If there isn't such a parameter, it will get the "fb_source" parameter passed by Facebook to know exactly where you visitor comes from in Facebook. (appcenter, notification, search, feed, ...)