title: Facebook AdPreview not rendering
body: <p>I'm trying to display an AdPreview for a sponsored post using the <a href="https://developers.facebook.com/docs/reference/ads-api/ad-preview-plugin/" rel="nofollow noreferrer">AdPreview plugin</a>. I already have the AdGroups created, as well as the corresponding AdCreatives, and so I know exactly what <code>creative_id</code>/<code>ad_id</code> I need to use to generate a preview off it.</p>
  
  <p>I do as the docs say:</p>
  
  <ol>
  <li>Load their plugin script, initialized with <code>xfbml=1</code> and <code>appId=&lt;myAppId&gt;</code></li>
  <li>Include the required HTML/XFBML where I want the preview to be displayed</li>
  </ol>
  
  <p>so I have it like:</p>
  
  <pre><code>&lt;body&gt;
    &lt;div id="fb-root"&gt;&lt;/div&gt;
    &lt;script&gt;(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all/xfbml.adpreview.js#xfbml=1&amp;appId=xxxxxxxxxx";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
  
    &lt;!-- other elements --&gt;
    &lt;div class="fb-ad-preview" data-creative-id="1234567890" data-page-type="desktopfeed"&gt;&lt;/div&gt;
    &lt;!-- other elements --&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>but when I load the page where I'm supposed to see this preview rendered, I only see an <code>iframe</code> appended inside <code>.fb-ad-preview</code>. This iframe points to a URL like this:</p>
  
  <pre><code>http://www.facebook.com/plugins/ad_preview.php?app_id=xxxxxxxxxx&amp;channel=http://static.ak.facebook.com/connect/xd_arbiter/LEdxGgtB9cN.js?version=40#cb=f2a62e0788&amp;domain=www.mycustomdomain.com&amp;origin=http%3A%2F%2Fwww.mycustomdomain.com%3A8000%2Ff12be91bcc&amp;relation=parent.parent&amp;creative_id=1234567890&amp;locale=en_US&amp;page_type=desktopfeed&amp;sdk=joey
  </code></pre>
  
  <p>which only loads some scripts that <strong>do absolutely nothing; not even throwing errors at all</strong>.</p>
  
  <p>However, I see a difference with the iframe in the plugin page: in the plugin page, in the <code>src</code> of the generated iframe, the <code>channel</code> querystring param points to <code>https://s-static.ak.facebook.com</code> instead of <code>http://static.ak.facebook.com</code>.</p>
  
  <p>When I visit my original url, but changing the subdomain to <code>https://s-static.ak.facebook.com</code>, a red, error-like box is displayed with a message <code>This plugin requires the use of the JavaScript SDK and XFBML.</code> :/</p>
  
  <p><img src="https://i.stack.imgur.com/TnAKk.png" alt="This plugin requires the use of the JavaScript SDK and XFBML"></p>
  
  <p>My Facebook application configuration has only <code>www.mycustomdomain.com</code> in <code>App domains</code> and <code>http://www.mycustomdomain.com:8000</code> (I'm building my webapp on python/django btw) and the app is not in "sandbox" mode.</p>
  
  <p>So I wonder two things:</p>
  
  <ol>
  <li>Why, in the first place, is the plugin using a different channel for me?</li>
  <li>Why is it not rendering the HTML as it does in the plugin page?</li>
  </ol>
  
  <p>I'm lost here, does somebody have any idea what's going on? Any help will be appreciated, please feel free to ask for details I might be missing to mention.</p>