title: Where exactly should I put the call to [FBSettings publishInstall:appId]
body: <p>I'm looking at integrating support for tracking Facebook's new mobile app ads.</p>
  
  <p>I've read the tutorial here:
  <a href="https://developers.facebook.com/docs/tutorials/mobile-app-ads/">https://developers.facebook.com/docs/tutorials/mobile-app-ads/</a></p>
  
  <p>It says:</p>
  
  <blockquote>
    <p>Include the following code to be executed when your app opens for the first time by user</p>
  
  <pre><code>[FBSettings publishInstall:appId];
  </code></pre>
  </blockquote>
  
  <p>So the first question is - where do I put this so that it only invokes the call if the install was driven from Facebook? I don't want FB to get credit for someone who found my app themselves on the app store.</p>
  
  <p>Do I need to manually track whether or not I've called the publishInstall before for this specific user? (The preamble sentence implies this - but the SDK documentation for publishInstall implies otherwise).</p>
  
  <p>And even more confusing is that the SDK FBSettings reference includes <code>shouldAutoPublishInstall</code> which defaults to <code>YES</code>. This would suggest that I don't need to do anything other than have the SDK integrated. So why does the tutorial not mention this as an option?</p>
  
  <p>I assume that the appId is the associated Facebook appId (as opposed to the App Store App ID). This is also not clear from the documentation.</p>