How to define specific page on hook_page_top?
You can use the request object to figure out what page you are on and what to do with it.

Fx

$uri = \Drupal::request()-&gt;getRequestUri();


Maybe you want to get the route name instead:

$route = \Drupal::routeMatch()-&gt;getRouteName();


From there it's just a matter of defining your conditions in the hook.