Custom Macro Script

That feature available only for PRO or higher editions

How to create a macro script

Directory for macro scripts /application/macros/.

To add new macro, we'll create a file /application/macros/randomx.php with code:

<?php
namespace Macros;
 
use Traffic\Model\BaseStream;
use Traffic\RawClick;
use Traffic\Macros\AbstractClickMacro;
 
class randomx extends AbstractClickMacro
{
    public function process(BaseStream $stream, RawClick $click, $min, $max)
    {
        return rand($min, $max);
    }
}

Make sure that class name and file name are the same.

In order to send parameters to macro script, just specify in macro:

{random:100,999}

It will send $min = 100 and $max = 999

To read more about $stream and $rawClick read page Internals.