How to preview an ad using the preview_url in the creative_spec?

I'm developing a Facebook connect site that manage Facebook Ad Campaigns and I have a small problem. When I'm creating an Ad using the API I receive the preview_url in the creative_specs of the ad created and then I want to show it in my website. However, the URL i get is inside Facebook. example:

I can't show it in an iframe because of facebook frame detect code, and i can't request to it in an AJAX call (i keep geting Bad Request 4xx)... So how on earth I can preview an ad I created using the Facebook ads api in my site??

thanks, Yaniv


You can check out this ref :

--- First you need to get the account CSS by

$url  = '' . $bizId  . '/adpreviewscss?access_token=' .  $access_token;

--- Then get the HTML part by

$url  = '' . $adId  . '/previews?access_token=' .  $accessToken;

--- Add this CSS patch

  /* ---- Ads Preview Styles ----------------------- */
                 .fbEmuPreview{border:1px solid #E5E5E5;background-color:#FFF;width:234px;padding:10px}
                 .fbEmu .title{font-weight:700;margin-bottom:0!important}
                 .fbEmu .forceLTR{direction:ltr;text-align:left;display:block}
                 .fbEmu .adInfo a.identity{color:gray;display:block;white-space:nowrap}
                 .fbEmu .image_body_block{padding-top:3px}
                 .fbEmuEgo .image{width:100px;display:block}
                 .-cx-private-uiimageblock__content a{font-size:11px}
                 .fbEmu .body .fbEmuLink{color:#333}
                 div.fbEmuEgo .image .img{padding-top:3px;max-height:72px;max-width:100px}
                 .fbEmuEgo .action{color:#777;margin-top:5px}
                .uiIconText .img{left:0;position:absolute;top:-1px;vertical-align:middle}
                .sx_39ed22{width:12px;height:11px;background-position:-49px -154px}

from the data you store in your database at the same time or from retrieving the ad details with the ad id from the api.

Need Your Help

I can't connect MySql C#

c# mysql

private void keepdata()

Set min, max and number of steps in radar chart.js

javascript chart.js

I am using 2.2.1 and have a radar chart that has values between 1..5. I want to set the min value to 0 and max to 5 with a step of 1.