title: Using setCampaignParamsOnNextHit (Android) and the iOS equivalent to attribute users in Google Analytics
body: <p>After reading the Android API and iOS setup guide for campaign/user attribution in Google's docs, I'm a little confused with how to read out parameters. We're using a third party library to pull in our campaign data, and so I have a list of keys like utm_source, utm_campaign, etc. that led to the user installing the app. I want to tell GA to use these parameters every time it sends an event.</p>
  
  <p>Now, according to the Android guide, it seems like I'll want to use <code>public void setCampaignParamsOnNextHit (Uri uri)</code> and re-encode my utm_* variables in a URI format. Does this method need to be called prior to every tracked event?</p>
  
  <p>Android guide: <a href="https://developers.google.com/android/reference/com/google/android/gms/analytics/Tracker.html#public-methods" rel="nofollow">https://developers.google.com/android/reference/com/google/android/gms/analytics/Tracker.html#public-methods</a></p>
  
  <p>The confusion is stemming from what I had read in their iOS guide:
  <code>Note that in the following examples, campaign data is not set on the tracker directly, as it only needs to be sent once</code>. It doesn't look like I'd need to re-encode any variables as I can just pass in a dictionary here.</p>
  
  <p>iOS guide: <a href="https://developers.google.com/analytics/devguides/collection/ios/v3/campaigns#general-campaigns" rel="nofollow">https://developers.google.com/analytics/devguides/collection/ios/v3/campaigns#general-campaigns</a></p>
  
  <p>I can code either language to either always call a set method before a track call or just set it once. Though, can anyone provide any clarity with these APIs? Ideally, I'd like to track all events with those original attributes intact.</p>