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 https://pushalert.co/
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.

<html>
<head>
<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 = "https://cdn.pushalert.co/integrate_c0108a215df8f0f09b1b72a6bfa87417.js";
    s.parentNode.insertBefore(g, s);
    }(document, "script"));
</script>
<!-- End PushAlert -->
</head>
<body >
</body>
</html>
<?php

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

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

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

        //YOUR CODE
    }
</script>

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

Thanks in advance.

Larry

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.