NAME

PrivatusAnalytics::PageProps - page props as JSON that is safe inside a script tag

SYNOPSIS

use PrivatusAnalytics::PageProps qw(page_props_json);

page_props_json([ plan => 'pro', seats => 5, beta => \1 ]);
# {"plan":"pro","seats":5,"beta":true}

DESCRIPTION

Keys follow the same rules as event props. Numbers, true and false and lists keep their JSON types. Lists keep at most 30 items. < > & and the characters U+2028 and U+2029 are written as \uXXXX, so the JSON cannot end the script early.

Perl has no separate true and false values before 5.36. Pass \1 and \0, or JSON::PP::true and JSON::PP::false, to get JSON true and false.

LICENSE

MIT. Copyright (c) 2026 Two Phase LLC.