Expand my Community achievements bar.

SOLVED

Dynamically Populate Random Number Within DTM

Avatar

Level 3

Hello,

I've been asked to dynamically populate a random number in the img src below:

    
<img src='http://h.nexac.com/e/a-858/s-1486/c-705/g-2423.xgi?pkey=xbue89gtzpg16&chpcm=&chpsg=&chpcr=&chpck=&ra...INSERTRANDOMNUMBER&chpth=' width='1' height='1' border='0'>

 

I've added this tag within DTM as a "Javascript / Third Party Tags" on one of our pages, but I do not know how to go about populating a random number for the rand URL parameter. Would I create a custom script data element to generate a random number?

1 Accepted Solution

Avatar

Correct answer by
Level 8

Hi David,

That's the way I'd go about it. Create a data element with a custom script in it to feed it the random number. You can then call this data element in your code.

Kind Regards

Rahul

View solution in original post

1 Reply

Avatar

Correct answer by
Level 8

Hi David,

That's the way I'd go about it. Create a data element with a custom script in it to feed it the random number. You can then call this data element in your code.

Kind Regards

Rahul