GTM – How to fire the same random number across multiple tags

Read Time:22 Second

I created a javascript variable to generate a random number and assigned to a custom HTML tag to push the value to the data layer.

Value pushed to a variable called OrdId

Data layer variable created to pull the value from data layer:

Data layer variable (OrdId) added to the Order ID parameter on floodlight tag setup.

Testing  – GTM debug

Push to data layer:

Tags firing with the OrdId unique value for all.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *