title: How to add EXTRA_REFERRER to CustomTabsIntent builder in Chrome custom tab for Android
body: <p>I am using newly launched Chrome Custom tabs for android instead of using webviews. <a href="https://developer.chrome.com/multidevice/android/customtabs" rel="nofollow">This is the link to their documentation</a></p>
  
  <p>Here is the code that shows how to use it.</p>
  
  <pre><code>String url = ¨https://paul.kinlan.me/¨;
  CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
  CustomTabsIntent customTabsIntent = builder.build();
  customTabsIntent.launchUrl(this, Uri.parse(url));
  </code></pre>
  
  <p>Question is that I want to add Intent.EXTRA_REFERRER to this. below is the para copied from their blog in their own words..</p>
  
  <blockquote>
    <p>It's usually very important for websites to track where their traffic
    is coming from. Make sure you let them know you are sending them users
    by setting the referrer when launching your Custom Tab</p>
  </blockquote>
  
  <pre><code>intent.putExtra(Intent.EXTRA_REFERRER, 
               Uri.parse(Intent.URI_ANDROID_APP_SCHEME + "//" + context.getPackageName()));
  </code></pre>
  
  <p>I failed to figure out any intent created to launch custom tabs.. Where to add this line?? If somebody has came across this, help please.</p>