<?php

$specificData = [
  "exampleField" => $page->exampleField(),
  "exampleHardData" => 'Example hard value'
];

$pageData = array_merge($genericData, $specificData);

echo json_encode([
  "page" => $pageData,
  "user" => $userData
]);