Facebook Pixel Event_ID - External_ID_ Purchase _Value - facebook

Can you who understands this please look at my pixel and see if it is correct.
I am trying to remove duplicates from the server side, and also fix the error "
Server External ID Not Matching to Pixel External ID for Purchase Event" and also add value
fbq('init', ‘1111’);
fbq('track', 'PageView');
fbq('track', 'Purchase', {value: 30, currency: 'USD'}, {eventID: 'Purchase', external_ID: ‘12345’ });
I tried the without the parameters, only purchaseyour text

Related

FB.ui share_open_graph strange dialog behaviour

I need to implement URL sharing on Facebook via javascript, sharing also a picture.
When the FB sharing dialog appears, it starts shrinking itself and keeps shrinking more and more until it becomes about 20 pixels wide.
And it happens using either the share_open_graph or "share" method.
Also, on the JS console i see this error when the sharing dialog appears:
ErrorUtils caught an error: "<![EX[["Could not find element \"%s\"%s
from module \"%s\"","u_0_18","","__el...".
Subsequent errors won't be logged; see https://fburl.com/debugjs.
This is my code:
<script>
$(document).ready(function() {
$.ajaxSetup({ cache: true });
$.getScript('//connect.facebook.net/en_US/sdk.js', function(){
FB.init({
appId: '476337039102253',
version: 'v2.8'
});
FB.getLoginStatus(APP.fbUpdateStatusCallback);
});
});
</script>
<button id="itb" class="btn btn-primary btn-large active_down" name="btn" onclick="
FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:url': 'https://example.com',
'og:title': 'page title',
'og:description': 'desc',
'og:image': 'https://savebybooking.s3.amazonaws.com/public/prd/File_341'
}
})
}, function(response){
if (response && !response.error_message) {
console.log('fb sharing OK: '+JSON.stringify(response));
} else {
console.log('Not OK: '+JSON.stringify(response));
}
}); return false;" type="submit">Share</button>
Are you having the same issue? Why is it happening?
I used the "share" method until yesterday without problems, this issue appeared today with no modification to my code.
p.s. I prefer
using share_open_graph
rather than
share
method because the latter won't let you share the specified picture but seems to pick a random image from the url you are sharing.
This is the error inside of the FB dialog, not inside the page launching the dialog. Also it's because you're missing the meta tags on the page you're sharing. Nothing for FB to scrape for your share.

Facebook feed dialog: allow user to select destination page or group

I'm using a Facebook feed dialog through JavaScript:
var p = {
method: 'feed',
name: 'Title',
caption: 'Subtitle - 26/02/2013',
description: 'My text',
link: window.location.href
};
FB.ui(p)
Is there a way to allow the user select the destination page for the feed ?
Usually the resulting dialog allows user to post a message on his own wall. I would like to enable destination select, like:
on my wall or on my page or into a group
With subsequent page or group selection, as happens on Facebook site.
Is there a way to show this kind of selection ?
The built-in share dialog included in the JavaScript SDK doesn't include this functionality. You will instead need to create your own dropdown with the options you want and then have the share button underneath. You will then need to find the value of this dropdown and add it to the to parameter of the FB.ui function:
<select id="to_user">
<option value="{user_id}">My wall</option>
<option value="{page_id}">My page</option>
<option value="{group_id}">My group</option>
</select>
<script>
var p = {
method: 'feed',
to: $('#to_user').val(),
name: 'Title',
caption: 'Subtitle - 26/02/2013',
description: 'My text',
link: window.location.href
};
FB.ui(p);
</script>
There is an option in the feed dialog box for selecting the destination.Please check
http://developers.facebook.com/docs/reference/dialogs/feed/

Client-side validation with Facebook Registration XFBML

I'm using XFBML embedded in a HTML5 document. I've set up client-side validation following the instructions provided in the "Registration Advanced Uses" doc on Facebook's site, but it only shows errors on blur, and doesn't validate when I click the "Register" button (so if I fill out a field wrong and click outside on another element, it displays the error, but then I can click on the Register button and it registers me anyway).
I've traced it in the JS debugger, and by adding alert/log statements, and my validate_registration function only gets called onblur, and never when I click the Register button.
Anyone seen this behavior and know what I'm missing here? The live example Facebook has on the "Registration Advanced Uses" works perfectly, so I know I've got a mistake somewhere.
My XFBML tag is this:
<div class="fb-registration"
onvalidate="validate_registration"
fields="[
{'name': 'name'},
{'name': 'first_name'},
{'name': 'gender'},
{'name': 'email'},
{'name': 'user_type', 'description': 'Are you a?', 'type': 'select',
'options': {
'parent': 'Parent/Guardian looking for childcare',
'sitter': 'Babysitter/Nanny looking for sitting jobs'
}
},
{'name': 'zip_code', 'description': 'Zip code', 'type': 'text'},
{'name': 'over_eighteen', 'description': 'I am at least 18 years old', 'type': 'checkbox' }
]"
fb_only="true"
redirect-uri="<%= parse_fb_connect_signed_request_users_url %>"
width="530">
</div>
and my validation function is this:
function validate_registration (custom_fields) {
var errors = {},
regexZipCode = /^\d\d\d\d\d$/;
console.log("in validate_registration");
if (custom_fields.user_type !== 'parent' && custom_fields.user_type !== 'sitter') {
errors.user_type = "Select either Parent or Sitter";
}
if ( ! regexZipCode.test(custom_fields.zip_code) ) {
errors.zip_code = 'Enter your 5-digit U.S. zip code';
}
if ( ! custom_fields.over_eighteen ) {
errors.over_eighteen = 'You must be at least 18 years old to use this site!';
}
return errors;
}
So, never mind this.
I was getting the message "You've just registered for X using your Facebook account.
If you didn't mean to do this, you can undo this below." and thought that it meant I had registered. But if I click "Continue" at that point, it shows me all the validation errors, so it does work correctly - it just doesn't validate until after the final step.

action links text in facebook post to wall dialog using javascript not working

I trying to bulid a facebook application using javascript.In my application, the user gets the result and a dialog after a time delay popup. Everthing is working well except one here's my code for the 'post to wall dialog'
<script>
var publish = {
method: 'stream.publish',
display: 'popup', // force popup mode
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
actions: [{ name: 'action_links text!', link: 'http://www.example.com' }],
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
href: 'http://www.example.com/'
}
};
FB.ui(publish, Log.info.bind('stream.publish callback'));
</script>
The line containing actions not working for me.Can anyone just inform what is the solution for this...
The property should be called action_links not actions and only have text and href values. Use something like:
action_links: [{ text: 'action link test', href: 'http://example.com'}]
Note that the action must be defined through the fb web interface for the app!

facebook stream.publish

I'm making a facebook app and using stream.publish to share something on a wall.
However for the 1) attachemnt link, and the 2) the FB UI action link, when I click either, it will load the page in the same browser window.
I would like to somehow add into these links something like target="_blank" so it opens the link in a new tab.
I know this is possible because when I share a video on youtube it has a target="_blank" on the action link and on the share link.
Does anyone know the trick?
I've tried code like this (I inserted the target blanks) but it doesn't add a target element in the hyperlinks:
FB.ui(
{
method: 'stream.publish',
message: 'Check out this great app! http://apps.facebook.com/{your_app}',
attachment:
{
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'),
'media': [{
'type': 'image',
'target': '_blank',
'src': 'http://test3.com/test.png',
'href': 'http://test3.com'}],
href: 'http://test2.com',
target: '_blank'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect',
target: '_blank'
}
);
Does anyone have any idea how youtube can accomplish the targets
I believe what you are looking for is
display: 'popup', after method: 'stream.publish'
target is in reference to a fb user_id to post a wall-to-wall