> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fingerprinting

## What is fingerprinting?

Fingerprinting is the process of generating an identifier for a specific payment method, without revealing any sensitive information. Contrary to payment method tokens, fingerprints cannot be used to make payments, which makes them a secure representation of payment method details.

Fingerprints are extremely valuable to:

* Check whether a particular card is used by multiple customers, which can be an indicator of fraud
* Track if a user is using the same card for multiple customer-present payments, which is a signal that a vault could greatly improve the user experience
* Save the preferred card of a customer

A payment method token is not a valid fingerprint since tokenizing or vaulting the same card multiple times yields different payment method tokens.

## Fingerprinting with Analytics ID

Primer API exposes [`analyticsId`](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/get-a-payment#response.body.paymentMethod.analyticsId) to act as a fingerprint for all payment methods. You can find this value

* in the Payment object, in the [API](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/get-a-payment.md#response.body.paymentMethod.analyticsId) and in the Workflow
* attached to a [saved payment method token](https://primer.io/docs/api-reference/v2.4/api-reference/payment-methods-api/list-saved-payment-methods.md#response.body.data.analyticsId)

`analyticsId` is unique per Primer account. Tokenizing the same card on multiple Primer accounts will generate different `analyticsId`

> [!NOTE]
>
> When Universal Checkout tokenizes the same payment method multiple times, a new single-used payment method token is generated each time, even if the payment method is part of your unified vault. On the other hands, the `analyticsId` attached to the payment method token remains the same.
>
> As a result, we recommend storing the `analyticsId` when you want to save the preferred vaulted payment method.

## How is Analytics ID created?

Although `analyticsId` is available for every payment method, its value heavily relies on how it is generated.

Check the following table to better understand how we create an `analyticsId` for each payment method:

| Payment Instrument Type | Analytics ID is created from... |
| - | - |
| Card | <ul><li>Primer Account ID</li><li>Card number</li><li>Expiry date</li></ul> |
| Google Pay | <ul><li>Primer Account ID</li><li>Card DPAN</li><li>Expiry date</li></ul> |
| Apple Pay *Agnostic processor* | <ul><li>Primer Account ID</li><li>Card DPAN</li><li>Expiry date</li></ul> |
| Apple Pay *Tied to a processor* | <ul><li>Primer Account ID</li><li>Apple Pay encrypted token (unique per payment attempt)</li></ul> |
| PayPal *Order (Single payment)* | <ul><li>Primer Account ID</li><li>PayPal Order ID (unique per payment attempt)</li></ul> |
| PayPal *Billing Agreement (Recurring payments)* | <ul><li>Primer Account ID</li><li>PayPal Billing Agreement ID (unique per agreement)</li></ul> |
| Klarna *Single payment* | <ul><li>Primer Account ID</li><li>Klarna authorization token (unique per payment attempt)</li></ul> |
| Klarna *Recurring payments* | <ul><li>Primer Account ID</li><li>Klarna authorization token (unique per agreement)</li></ul> |
| *Other* | *Random ID* |

## Example: Blocking payments coming from a specific card

Let’s imagine you have identified a very specific card that you want to block from making any additional payments.

First, retrieve the `analyticsId` you want to block from the payment object.

Then, head to your card-processing workflow and add a route with a condition that checks if the Analytics ID of the payment matches the `analyticsId` you want to block.

![](https://goat-assets.production.core.primer.io/marketing/payment-capabilities/external-docs/fingerprinting/condition-analyticsid.png)

Conditions with analyticsId

Finally, add a "Decline payment" action to this specific route so that payments with this `analyticsId` are automatically blocked.

![](https://goat-assets.production.core.primer.io/marketing/payment-capabilities/external-docs/fingerprinting/fingerprinting-workflow.png)

Workflow

> [!NOTE]
>
> If you want to block an entire BIN, you can instead create a condition that checks the first 6 digits of the card.
>
> ![](https://goat-assets.production.core.primer.io/marketing/payment-capabilities/external-docs/fingerprinting/condition-bin.png)
>
> Conditions with BIN


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.