Getting id of vistor to use in TagManager

Is there a simple way to get the current vistor id in a TagManager plugin? In the script I want to combine data from the visitor and my custom code.

Hi,

there are several ways to do this.
If you want to get the visitor id which is eg. also visible in the Cookie you can try this as customHTML and crosscheck if its the correct one.

<script>
var visitor_id;
_paq.push([ function() { visitor_id = this.getVisitorId();
console.log(visitor_id); 
</script>

Additionally you can push it to the data layer and store it as a variable.
Pleas let me know if you need any further support.

Thanks, I will try this out.