title: How to filter by custom parameter in Google Analytics API?
body: <p>I'm trying to get a list the most visited pages for mu website from Google Analytics API. Currently I have the following code and that returns a list with a title, url and number of visitors of each page:</p>
  
  <pre><code>data_query = service.data().ga().get(**{
      'ids': 'ga:123456789',
      'dimensions': 'ga:pageTitle,ga:pagePath',
      'metrics': 'ga:pageviews',
      'start_date': '2013-12-31',
      'end_date': '2014-04-29',
      'sort': '-ga:pageviews',
  })
  feed = data_query.execute()
  </code></pre>
  
  <p>The problem is that all pages of the website can be rendered in Spanish or in English, so as a result I get duplicated rows for the same url, for example:</p>
  
  <pre><code>[
      ['/index/', 'Inicio', 23],
      ['/index/', 'Home', 57],
  ]
  </code></pre>
  
  <p>In order to be able to filter results by language I'd to get something like this:</p>
  
  <pre><code>[
      ['/index/', 'Inicio', 23, 'es'],
      ['/index/', 'Home', 57, 'en'],
  ]
  </code></pre>
  
  <p>Following Google Analytics instructions, I created a new dimension 'lang' ('dimension1') and in my html template I pass its value dynamically depending on the current language as <code>en</code> or <code>es</code>:</p>
  
  <pre><code>&lt;script&gt;
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  
  ga('create', 'xxx', 'yyy');
  ga('send', 'pageview');
  ga('set', 'dimension1', 'en');   // &lt;----- or 'es'
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But this query</p>
  
  <pre><code>data_query = service.data().ga().get(**{
      'ids': 'ga:123456789',
      'dimensions': 'ga:pageTitle,ga:pagePath,ga:dimension1',
      'metrics': 'ga:pageviews',
      'start_date': '2013-12-31',
      'end_date': '2014-04-29',
      'sort': '-ga:pageviews',
  })
  </code></pre>
  
  <p>aways returns me an empty list.</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>It turned out that the dimension was set, but ga was not sending the value correctly, and this code did the thing:</p>
  
  <pre><code>ga('send', 'dimension1', 'en');
  </code></pre>