How to send Measurement Protocol if there is no ClientID?

I need to send Measurement Protocol, but clietID cookie may not exist. ClientID is required parameter. What to do in this case? Generate it? In which way? (I need to do in on PHP)

Upvotes: 2

Views: 2934

Answers (2)

Franz Wilding
Franz Wilding

Reputation: 33

If anyone else have the problem that hits wont get registered, if cid is empty, I just found out that the docs are wrong:

Client ID: Optional. This field is required if User ID (uid) is not specified in the request.

cid is always required, even if uid is set. Otherwise the hit won't get registered.

Upvotes: 3

Daryl Wenman-Bateson
Daryl Wenman-Bateson

Reputation: 3964

The clientId is used to tie up the session. You can post a dummy clientId as a UUID, but the event will be stored in a new session. Take a look at Client Id section within Measurement Protocol - more information on UUID can be found inside of A Universally Unique IDentifier (UUID) URN Namespace

If you are working with a User (as opposed to standard) View, the UserId can be used to tie multiple sessions together, providing the UserId (UID) matches

Upvotes: 2

Related Questions