Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Integer or UUID</strong></p> <p>The <code>cid</code> is the equivalent of the second value in the <code>_utma</code> cookie when you use the javascript tracking. In js tracking, it is a random integer (generated by <code>Math.round(2147483647 * Math.random())</code>). But it is strored and sent as a string : so you can use both formats (integer or UUID).</p> <p><strong>Required/Optional</strong></p> <p>With js tracking, a request sent with a missing user id is ignored by Analytics servers. So assume that it is required.</p> <p><strong>Link web visitor with measurement protocol actions</strong></p> <p>If you want to link your backend user with a visitor previously tracked with Analytics javascript <code>ga.js</code>, you can get the <code>cid</code> value from the <code>_utma</code> cookie. But I don't recommend it; each time it changes (terminal or browser change, cookies cleaning, etc.), you will lose the link with your customer's previous actions.</p> <p><strong>Update</strong></p> <p>The <code>analytics.js</code> did not exist when the question was asked. <code>cid</code> is now stored in the cookie <code>_ga</code>. You can get it in javascript with:</p> <pre><code>ga(function(tracker) { var clientId = tracker.get('clientId'); }); </code></pre> <p>As of writing this, when you do get the clientId from the tracker as in the above code it won't give you a UUID but two random 32-bit integers in the format of "X.Y". This implementation may change to the UUID in the future. </p> <p>Or set it with your own value (like a backend generated UUID):</p> <pre><code>ga('create', 'UA-XXXXX-Y', {'clientId': 'your_client_id'}); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload