Skip to content

Can I create a unique ID for Public User? #11006

Answered by ConorWebb96
BKDragon asked this question in Help
Discussion options

You must be logged in to vote

Hey @BKDragon,

Due to this not being something you can natively do in Budibase. I've had to hack some things together to get this functionality working. I would recommend looking at making a custom plugin to include functionality like this. However, if you don't want to do that you can see the example below of what I've done and from there try to change it to suit your needs.

I won't explain what the code does, as from your mentioning of cookies and localStorage I'm assuming you will already know.

  1. Add an embed component to your page.
  2. Add the below code to the embed component.
<img style="display: none;" src onerror="if (document.cookie.indexOf('uniqueID') === -1) {document.cookie = 'uni…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@BKDragon
Comment options

@ConorWebb96
Comment options

Answer selected by ConorWebb96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
forms actions Relating to Budibase app actions app-state Using the Update State action in Budibase
2 participants