Battling with getting console.log() into PHP variable

Hi - I’m having an absolute nightmare trying to figure this out.
My app is written in PHP, we are using PushAlert
I have followed all their instructions and am able to register a subscriber.
The problem I am running into is getting the subscriber id into a PHP variable and where to put the code in. I have asked them but they answered since we are using their API, they can’t help, beside share the code to use.

The code used asking the user to subscribe which works is below.

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- PushAlert -->
<script type="text/javascript">
(function(d, t) {
    var g = d.createElement(t),
    s = d.getElementsByTagName(t)[0];
    g.src = "";
    s.parentNode.insertBefore(g, s);
    }(document, "script"));
<!-- End PushAlert -->
<body >

Then the code they shared that gets the subscriber id, which is where I am battling and need help getting into a PHP variable.

    (pushalertbyiw = window.pushalertbyiw || []).push(['onReady', onPAReady]);

    function onPAReady() {
        console.log(PushAlertCo.subs_id); //if empty then user is not subscribed

        //YOUR CODE

If someone could please help, it would be very much appreciated.

Thanks in advance.