i'm using the Facebook Pixel tracking in one of my (shopping) sites i'm supervising.
For this, i put the standard code into the head section or better said into the head.phtml for a more generic way of handling.
The PageView pixel is fine all the time. But on my checkout success page there is some strange behaviour, because Facebook Pixelhelper tells me first, that the Pageview is loaded successfully. After that, it tells me that the Purchase Pixel is also loaded successfully. And as last, it tells me that the Purchase Pixel did not load. In the FB Pixelhelper the 1st and 2nd pixels are shown fast (Pageview and Purchase), then it takes ~1-2 seconds until the 3rd pixel appears in the list.
The 1st purchase pixel in the FB Pixelhelper shows the URL called for the purchase and all is fine. The 2nd purchase pixel just shows the fbq - track like shown later.
I've included the track in a script tag on the onepage checkout success page with the code:
fbq('track', 'Purchase', {value: '<?php echo number_format($total, 2, '.', ','); ?>', currency: 'EUR'});
There is no other occurency of any Purchase track in the HTML code.
As i do not have access to the FB Backend for tracking, i can't do any checks against code changes.
Even more interesting: On the development system all is fine. The only difference is no https on the checkout. The fbevents.js is included like intended to be with //connect.facebook.net/en_US/fbevents.js so i think, this shouldn't be the problem at all.
Any ideas how i can track this double firing or fix it? Or is there a known issue?
Related
Sorry if this has been asked many times but I really got confused on how to use facebook pixel.
I have a landing page (success page) where I want to track how many users have landed to that page.
I am confused between PageView and ViewContent.
In my case, what should I use so I can track the pixel?
#Andrew's answer shows the most useful Facebook page for events.
Watch out because there is another page that shows a similar list of events without even mentioning any parameters. It just says to do fbq('track', 'ViewContent') which is USELESS!
You must do the following to get useful data:
fbq('track', 'ViewContent', { content_name: 'Homepage' });
The PageView event just automatically sends the URL and takes no parameters and is part of the default configuration.
Also be sure to use the 'Test Events' panel to see in real time (instantly!) when your events come through.
The Facebook documentation here explains:
https://developers.facebook.com/docs/facebook-pixel/api-reference#events
In the documentation it says:
The default pixel code fires the PageView event, which can be used to
create Custom Audiences and custom conversions that match referral
URLs. This event should not be removed as it may cause disruption to
the aforementioned rules.
According to FB, the ViewContent event is for:
When a key page is viewed such as a product page, e.g. landing on a
product detail page
Here is an example of the usage of ViewContent
https://developers.facebook.com/docs/facebook-pixel/api-reference#utilizing_params
I have a Facebook Pixel on my website that is tracking events. I saw on the Ads Manager dashboard, that the pixel logs my events in a categorized way, i.e.:
PageView, ViewContent, InitiateCheckout, etc.
Although when logging stats, I include some extra parameters like the product_id maybe or other things, that way when the PageView is being logged, at least I will know which product_id it refers to.
The problem is that the Facebook Ads Dashboard doesn't show any of the extra parameters, it only displays the Count field.
After doing some research, I found this link on Facebook Pixel Stats, where they claim:
Use the Facebook Pixel Stats edge to get pixel statistics.
I tried using the Graph API Explorer, and even the iOS FB SDK for it (API Here) they both return an empty data array:
{
"data": [
]
}
I tried multiple parameter combinations, fields, and everything else to no avail.
If anyone knows whether I'm looking at the wrong place, or what not, all I'm interested in is reading those "extra" parameters that I'm appending to every FB Pixel event I log. Thank you!
You need specifing the parameters for it.
Example:
{fb_pixel_id}/stats?aggregation=url
The answer is displayed for a specific period of time in the past - I would say 24 hours.
You can use paging at the bottom of the json response for going back in time: use the link provided in the content of the field 'previous', and you can step back day by day.
Hi I have an issue with experiments.
This is my original page: http://cellulem.netlogiq.com/test1.html
and the variations 1: http://cellulem.netlogiq.com/test2.html
The problem is when I access the test1.html page, it redirected me always on the same page, after a few seconds.
I inserted the experiment code right after the head tag, and after that the tracking code.
so any ideas why???
This sounds like expected behaviour. The experiment redirects you to the same page because recurring visitors need to see the same page for every pageview/visits (it would confuse the heck out of your visitors were they to see different pages for every pageview, plus it would ruin your experiment).
Try and delete your cookies between reloads so the Google does not recognize you as recurring visitor. Try at least ten reloads (the code redirects randomly, not alternating - it's not unusual to get the same page four or five times in a row if you just have one variation).
Updated to include the discussion from the comments:
The experiment code only goes into the original page (else there will be unwanted redirects on other pages). If you have a common header in your template you could check if you are on the original page by inspecting the current url, like so:
if(window.location.href === 'original.html ') {
// display experiment code
}
I am trying to display a comments feed on my Facebook application, I am loading in an array of Facebook user ids and an associated comment, to display the users profile picture, I am using the following snippet:
<?php echo '<img src="http://graph.facebook.com/'.$c->_user.'/picture'" />; ?>
This works fine, and gets the image, however, if I refresh my page, I get some if not all of the thumbnails will not be loaded, refresh again and they'll always be there, it's pretty consistent that when I refresh they'll appear, next time they won't and so on.
Should I be dealing with this differently ? I know that in the browser the graph API redirects to the actual image, so maybe this is what's causing my browser to sometimes not display them, say if, it took too long to load the image ?
The issue is probably what genesis φ says says, just a temporary issue on Facebook's end. But to add on to his suggestions, you might try serving the image from https:. Alternatively, you can get the full, redirect-less picture URL from the user FQL table.
It's probably just their temporary issue. If you want to be sure, download them for the first time and you could "host" them more reliabily
Okay so first off, sorry if the title doesn't make much sense...I'm not sure how else to summarize it!
So here's the issue:
I am using jQuery to attach a click event to my form's submit button. The jQuery click event triggers some GA code to track a virtual page view so I can use it as a step in a Goal funnel.
But what happens is that there's no delay between the GA code executing and the submit, so I'm concerned that GA isn't actually getting the data.
When I look at what's happening in firebug or httpfox (browser addons that look at the requests/response) vs. charles proxy (external sniffer, separate from browser) I am seeing two different things.
With firebug/httpfox I see the GET request to GA but status of 0 and it is showing up as
(Aborted) NS_BINDING_ABORTED
...though it does show bytes having been sent etc.. just nothing for response.
But with charles proxy, I am seeing the same GET request with a status of 200 and the 1x1 pixel response.
So my theory here is that GA is receiving the data, but that the browser is moving on before it gets the actual response - which I'm okay with, as long as GA is getting the data, I'm okay with this. But it is just my theory and I don't know...
I know I can write the code to simply delay the execution of the submit by 500ms or whatever as insurance, but I don't wanna have to do that if it's not necessary..
And I know if nothing else I can just see if the data is showing up in GA but GA has a 24-48 hour delay on data so it is hard to QA.
Does anybody know or have any suggestions from experience...has anybody else experienced this "abort" thing and can say one way or the other if it is necessary to delay the submit or whatever?
HTTPFox is not a real sniffer. It just tries to mimic one. So the data you see on it is not always what is really happening in the background. Charles should get you a better picture. If you're seeing the 200 code in Charles. So the chances are that the hit is going through.
The bad news is that when you fire hits at the time the page unloads. (Outbound clicks, insite link clicks, form submissions, window.unload, etc) they won't go through every now and then. This happens because the Google Analytics JS Call basically appends a GIF to the page. And it returns after that. Than the browser will load the gif. When the code returns the browser is free to go, and if it goes away from the page it will cancel any pending requests that it may have, including that small GIF image. So the browser might haven't sent the tracking code, or might have sent it, but the TCP connection didn't go through and the browser would need to resend the package, but he's not willing to do it anymore.
So if accuracy is a need for you, you should add a 200-500 ms delay to it. But remember that Google analytics is not an Accuracy Tool, and if some events don't go through it won't probably affect the final outcome of your analysis.
According to the informatin on this page: Sending Data to Google Analytics there is a possibility that your data is not really being sent (the bad news, as Eduardo said). Transcribing the most important information of that page, related to your doubts:
Many browsers stop executing JavaScript as soon as the page starts
unloading, which means your analytics.js commands to send hits may
never run.
An example of this is when you want to send an event to Google
Analytics to record that a user clicked on a form's submit button. In
most cases, clicking the submit button will immediately start loading
the next page, and any ga('send', ...) commands will not run.
The solution to this is to intercept the event to stop the page from
unloading. You can then send your hit to Google Analytics as usual,
and once the hit is done being sent, you can resubmit the form
programmatically.