$cid1 and $cid2 are not set anywhere. Let's clean up measurement_protocol_get_cookie(). What is really needed is a cid, so let's rename it to measurement_protocol_get_cid(). If a _ga cookie is found then use the relevant portions of it. If not, generate a UUID.

Comments

jacob.embree created an issue. See original summary.

jacob.embree’s picture

Status: Active » Needs review
StatusFileSize
new2.47 KB

Perhaps this is a bit hasty, but here's a patch to implement the suggestion in the original post.

jacob.embree’s picture

Issue summary: View changes
Status: Needs review » Active

Updating the issue summary.
The patch in #2 is misguided.

jacob.embree’s picture

Issue summary: View changes
jacob.embree’s picture

jacob.embree’s picture

Status: Active » Needs review
StatusFileSize
new1.96 KB

To use the uid parameter it's necessary to set up User ID tracking at Admin->Property->Tracking Info->User-ID.
This patch uses uid first, and cid for anonymous users.

Somebody, please, jump in with suggestions or explanations of why the current code shouldn't change.

jacob.embree’s picture

With "session unification" it's no problem to have both uid and cid set. This patch sets cid no matter what and uid if the user is authenticated.

jacob.embree’s picture

Issue summary: View changes

Updating issue summary.

vladsavitsky’s picture

Status: Needs review » Reviewed & tested by the community

Patch fixes described issue and works fine.

nvahalik’s picture

Sorry it took so long—I never saw notifications about these. Committed!

nvahalik’s picture

Status: Reviewed & tested by the community » Fixed
jacob.embree’s picture

@nvahalik, thanks! It looks like you committed to the master branch instead of 7.x-1.x. After you commit to 7.x-1.x you should probably remove the master branch to avoid confusion. See https://www.drupal.org/empty-git-master for details.

  • nvahalik committed ec71ce7 on 7.x-1.x authored by jacob.embree
    Issue #2915927 by jacob.embree: Notice: Undefined variable: cid1 in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.