@anonymous-piwik-user opened this Issue on February 25th 2013

In order to set a custom visitor Id, the parameter cid is used in PiwikTracker.php (see [https://github.com/piwik/piwik/blob/ce63a9fbc4727df77a351fc55a641693d10a4f5c/libs/PiwikTracker/PiwikTracker.php#L1047]). However, it cannot be used to distinguish Visitors as distinct.

Steps to reproduce:

The visitor is known (idvisitor = fbface7fb484cf60,
                            config_id = 6da98b12e33904b4,
                            idvisit = 1270,

(Complete output attached)

Also, cid is not documented in the FAQ [http://piwik.org/docs/tracking-api/reference/].

May be related: #3312

@anonymous-piwik-user commented on February 25th 2013

Attachment: Tracking Debug Output
piwik.html

@anonymous-piwik-user commented on February 25th 2013

Attachment: Visitor Log: Only one visit (instead of several), wrong visitor id
crushed.png

@anonymous-piwik-user commented on February 25th 2013

Attachment: 2nd test output
test.html

@anonymous-piwik-user commented on February 25th 2013

Using Piwik 1.10.1 . API key is admin user of idsite(2).

@anonymous-piwik-user commented on February 25th 2013

Oh, sorry: auth_token should be token_auth, of course. Attached a new version of the output, as the problem remains:

Matching visitors with: visitorId=1234567890123456 OR configId=6da98b12e33904b4<br />
The visitor is known (idvisitor = bb0ccf88648b5ee2,
...

In case of a forced (vs. indicated via _id) visitorId it should only match by visitorId.

@anonymous-piwik-user commented on February 25th 2013

I've sent a pull request on github: https://github.com/piwik/piwik/pull/35 - which fixed the issue for me.

@mattab commented on March 3rd 2013 Owner

Thanks for the report, very nice find. I agree with your proposal, that when a user has called $tracker->setVisitorId( ) and has authenticated with token_auth, then the visitor ID should be enforced.

@mattab commented on March 3rd 2013 Owner

In 12c3fbeb845c42d493df4440e35ccf95c3dcae45: Fixes #3776, Fixes #3787

Adding integration test to test this code.

I also updated tracking api reference to explain "cid" parameter.

cid (requires token_auth to be set) defines the visitor ID for this request. You must set this value to exactly a 16 character hexadecimal string (containing only characters 01234567890abcdefABCDEF). When specified, the Visitor ID will be enforced. This means that if there is no recent visit with this visitor ID, a new one will be created. If a visit is found in the last 30 minutes with your specified Visitor Id, then the new action will be recorded to this existing visit.

@mattab commented on March 3rd 2013 Owner

Tracking API updated

@mattab commented on September 8th 2014 Owner

see also #6109

This Issue was closed on March 3rd 2013
Powered by GitHub Issue Mirror