title: Branch.io: how to merge events sent server-to-server with user installs reported from the client?
body: <h2>The setup</h2>
  
  <p>I have an iOS app with a basic Branch SDK integration. All it does is:</p>
  
  <ul>
  <li>reports the install event (via initSession() call)</li>
  <li>some time later calls setIdentity() method to identify the user with an ID received from backend</li>
  </ul>
  
  <p>Later inside the app the user is offered a subscription with a trial period. The backend receives a notification once the trial is started. I want to report the trial start from my backend to the Branch (server-to-server way) so it is attributed to the Branch channel/campaign and I can see the efficiency of each campaign inside the "Sources" tool in Branch.</p>
  
  <p>To do this I execute the following curl request in accord with the documentation <a href="https://github.com/BranchMetrics/branch-deep-linking-public-api#logging-user-lifecycle-events" rel="nofollow noreferrer">https://github.com/BranchMetrics/branch-deep-linking-public-api#logging-user-lifecycle-events</a>:</p>
  
  <pre><code>curl -vvv -d '{"name": "START_TRIAL","customer_event_alias": "Trial Start","user_data": {"os": "iOS","environment": "FULL_APP","aaid":"93A6BC61-AC2B-4008-9565-4DF2FD2395C9","limit_ad_tracking":false,"developer_identity": "41740","country": "US","language": "en"},"custom_data": {"product_id": "my.product.id"},"metadata": {},"branch_key": "key_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' https://api2.branch.io/v2/event/standard
  </code></pre>
  
  <p>The received answer is:
      {"branch_view_enabled":false}</p>
  
  <p>As seen from the request I pass the IDFA and developer_identity and I expect that it would be enough to attribute START_TRIAL event to the Branch channel/campaign, which brought the user.</p>
  
  <h2>The problem</h2>
  
  <p>The START_TRIALS and other valuable events are attributed to organic traffic. So for a test campaign I see a click, an install an open but zero trial starts. The trial start is attributed to the organic traffic.</p>
  
  <h2>What I've checked</h2>
  
  <p>I've checked with Charless SSL that the user ID is sent by Branch SDK to Branch backend (notice same IDFA <strong>93A6BC61-AC2B-4008-9565-4DF2FD2395C9</strong> and user id <strong>41740</strong>):</p>
  
  <blockquote>
    <p>"os": "iOS",
        "hardware_id": "<strong>93A6BC61-AC2B-4008-9565-4DF2FD2395C9</strong>",
        "screen_width": 750,
        "identity_id": "789438365770392069",
        "build": "16G183",
        "ios_vendor_id": "A3656BAB-CDF9-4572-B944-80D5B6017376",
        "hardware_id_type": "idfa",
        "instrumentation": {
            "/v1/install-brtt": "406"
        },
        "environment": "FULL_APP",
        "model": "iPhone7,2",
        "identity": "<strong>41740</strong>",</p>
  </blockquote>
  
  <p>So given all of the data I already pass to Branch, what else should I do to merge events sent server-to-server with user installs reported from the client?</p>