Visitor identification
How do we manage visitor identification
What is visitor identification
Visitor identification is the basis of all calculations in Analytics.
Without a perfect management of this identifier, and a real persistence, we would not be able to calculate an exact number of visits and visitors.
This visitor identifier, present on all the events we collect, is personal data. More information is available in our Privacy Center.
How it works
- Javascript
- Apple
- HTTP
The visitor identification is created the first time you use a pa.sendEvent()
/ pa.sendEvents()
method.
The information is first stored in a cookie, and then sent to all future events into a query parameter.
Cookie | Querystring parameter | Format | SDK version |
---|---|---|---|
pa_vid | idclient | GUID | < 6.7.0 |
_pcid | idclient | 16 char. | >= 6.7.0 |
The visitor ID must be 16 or 36 characters long.
The visitor identification is created the first time you use a pa.sendEvent()
/ pa.sendEvents()
method.
Here is the decision tree leading to the output depending on configurations:
The management of the visitor identification is delegated to you when you use our Collection API.
Please, note that a break in the identifier will create a new visit and the detection of a new visitor.
A GUID
format is recommended.
As the visitor identification is a key notion in Analytics (visits, visitors, ...), we recommend that you do not change our SDKs behavior regarding its management.
Legacy visitor management
More information about legacy visitor management in our Cookies & storage article.
Visitor identification configuration
You can configure the visitor identifier to suit your needs.
- Javascript
- Android
- Apple
- HTTP
Visitor identification behaviour you can modify:
Name | Description | Type | Value |
---|---|---|---|
storageLifetimeVisitor | Lifetime Storage Visitor value | int | 395 (days) |
visitorStorageMode | Relative or fixed cookie lifetime value for visitor | string | fixed (default), relative |
isVisitorClientSide | Is cookie deposit client side ? If false , server side | boolean | true (default), false |
To setup the configuration, please consult our Javascript SDK article.
Visitor identification behavior you can modify:
Name | Description | Type | Value |
---|---|---|---|
storageLifetimeVisitor | Lifetime Storage Visitor value | int | 395 (days) |
visitorStorageMode | Relative or fixed cookie lifetime value for visitor | string | fixed (default), relative |
ignoreLimitedAdvertisingTracking | Whether the SDK should ignore (true ) or not (false ) the end-user choice to limit ad tracking. | boolean | true , false (default) |
visitorIdType | Visitor ID type | string | uuid (default), androidId , advertisingId , googleAdvertisingId , huaweiOpenAdvertisingId , custom |
visitorId | Custom visitor ID | string | 39001HUFEKK977894 |
To setup the configuration, please consult our Android SDK article.
Visitor identification behavior you can modify:
Name | Description | Type | Value |
---|---|---|---|
storageLifetimeVisitor | Lifetime Storage Visitor value | int | 395 (days) |
visitorStorageMode | Relative or fixed cookie lifetime value for visitor | string | fixed (default), relative |
ignoreLimitedAdvertisingTracking | Whether the SDK should ignore (true ) or not (false ) the end-user choice to limit ad tracking. | boolean | true , false (default) |
visitorIdType | Visitor ID type | string | uuid (default), idfa , idfv , custom |
visitorId | Custom visitor ID | string | 39001HUFEKK977894 |
To setup the configuration, please consult our Apple SDK article.
When using the Collection API, you manage the visitor identifier.
Visitor identification management
In some specific cases, it can be useful to manage the visitor identifier yourself.
We provide you with dedicated methods for that matter.
- Javascript
- Android
- Apple
- HTTP
Method:
pa.setVisitorId(visitorId)
Parameter | Type | Description | Format |
---|---|---|---|
visitorId | string | Visitor identifier | GUID or 16 char. long |
pa.setVisitorId('97c7db4e-4514-4b8e-b693-bd6b57043cc1');
You can also retrieve the visitor ID with a dedicated method. This can be useful to synchronize an ID between native and webviews.
Method:
pa.getVisitorId()
const PAVisitorId = pa.getVisitorId();
Method:
func PianoAnalytics.setVisitorId(_ visitorId: String) -> void
Parameter | Type | Description |
---|---|---|
visitorId | String | Visitor identifier (GUID recommended) |
pa.setVisitorId("97c7db4e-4514-4b8e-b693-bd6b57043cc1")
You can also retrieve the visitor ID with a dedicated method. This can be useful to synchronize an ID between native and webviews.
Method:
func PianoAnalytics.getVisitorId(PianoAnalytics.OnGetVisitorIdListener) -> void
pa.getVisitorId(visitorId -> {
// visitorId fetched
});
Method:
pa.setVisitorId(_ visitorId: String)
Parameter | Type | Description |
---|---|---|
visitorId | String | Visitor identifier (GUID recommended) |
pa.setVisitorId("97c7db4e-4514-4b8e-b693-bd6b57043cc1")
You can also retrieve the visitor ID with a dedicated method. This can be useful to synchronize an ID between native and webviews.
Method:
pa.getVisitorId(completionHandler: ((_ visitorId: String) -> Void)?)
pa.getVisitorId { visitorId in
print(visitorId)
}
When using the Collection API, you have to feed the visitor identifier directly into the idclient
querystring parameter.