Jump to content


Anonymous Contact trackingKey

  • Please log in to reply
1 reply to this topic

#1 bapf


    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 08 June 2018 - 11:52 AM

Hi x2 Support team,


I use the webTracker JavaScript and get AnonymousContacts created.


Once a anonymous website visitor post his email address it is generated via REST API. Works fine!


What parameters have to be submitted in order to assign the AnonymousContact-Browsing-History to the created Contact.


Actually once the new Contact is created the browsing history is still be shown in the AnonymousContact ID.


I have seen in Contacts Mysql database table there is a fingerprint and trackingKey field and I copied the values from the AnonymousContact in it but it didn't show up....


Then I set in x2_fingerprint tabel "anonymous"=0 and histroy shows up in the new contact. My question: Is there any function I can use or do I have to convert it all manual through API calls? If I use the API how is the best practice from fingerprint ID over cookie and trackingKey? I notice that TrackingKey of Cookie is different to Fingerprint TrackingKey of AnonymousContacts.


Thanks for your help in advance! I researched all topics in this forum but there is not yet an answer.

#2 X2Peter


    Advanced Member

  • Administrators
  • 82 posts

Posted 17 October 2018 - 02:28 PM

Hello Bapf,


The fingerprint is created for an anonymous contact via the web tracker whenever someone visits your public-facing site (when the web tracker JS is included on the site). Once the anonymous contact fills in a webform or otherwise uses the weblead api, a contact is created and the anonymous contact is merged with the newly created contact record. If you are able to get a user's info from outside the web forms then I would suggest using the web lead api in order to create a new contact with that fingerprint. There technically is no api function to do the merging however the web lead api will eventually call a merging function to merge the anonymous and known contact.  Let me know if this answers your question or if you have any other questions regarding fingerprinting.


If you are interested in the code, here is the actual block which starts the merge:

        // Check for fingerprint and attributes
        // if there's not an anonyomous contact, then the fingerprint match
        // was for an actual contact.
        if (Yii::app()->contEd('pla') && Yii::app()->settings->enableFingerprinting &&
            isset ($this->jpost['fingerprint'])) {
            $attributes = (isset($this->jpost['fingerprintAttributes']))?
                json_decode($this->jpost['fingerprintAttributes'], true) : array();
            $anonContact = AnonContact::model ()
                ->findByFingerprint ($this->jpost['fingerprint'], $attributes);
            if ($anonContact !== null) {
                $this->model->mergeWithAnonContact ($anonContact);
            } else {
                $this->model->setFingerprint ($this->jpost['fingerprint'], $attributes);

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users