Expand my Community achievements bar.

SOLVED

Random number Data Element type

Avatar

Level 3

Hi,

 

I am working on a third party integration in Adobe Data Collection and I have the need to populate a specific conversion parameter with a unique ID. I haven't got any value related to the conversion ID available at the moment, neither on the url nor the dataLayer object. 

I can see that I have available in Data Collection a Data Element called Random number that generates a hit ID according to the official documentation:

Random number

Use this data element to generate a random number. It’s often used for sampling data or creating IDs, such as a Hit ID. The random number can also be used to obfuscate or salt sensitive data. Some examples might include:

  • Generate a Hit ID
  • Concatenate the number to a user token or timestamp to ensure uniqueness
  • Perform a one-way hash on PII data
  • Randomly decide when to show a survey request on the site

Specify the minimum and maximum values for your random number.

Defaults:

Minimum: 0

Maximum: 1000000000

 

My only concern is if it generates only unique IDs, not repeating instances up to the maximum figure. It is important for me to know this information because I am integrating the conversion tag of the third party provider and would like to make sure that all values are unique. 

 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @RaulFo ,

You can combine the random number with something else that changes frequently or is user/session-specific.

Example: Timestamp

let randomNum = Math.floor(Math.random() * 1000000000);
let timestamp = Date.now();
return timestamp + "-" + randomNum;

 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

Hi @RaulFo ,

You can combine the random number with something else that changes frequently or is user/session-specific.

Example: Timestamp

let randomNum = Math.floor(Math.random() * 1000000000);
let timestamp = Date.now();
return timestamp + "-" + randomNum;