initializing Pendo without using the Snippet

My app was written in CodeIgniter (php) and uses Okta for Authentication. When a user first logs in their email is sent from Okta to my app in a cookie. My app gets the cookie at the top of the first tab (dashboard). This is the code that gets the user's email identifier:

//only run this first time
if (($this->session->userdata('userid'))==NULL) {
if (!isset($_COOKIE['email'])) //no cookie show the exit
$this->session->set_userdata('userid', $_COOKIE['email']);

If there is no cookie, the app exits. 

For this reason placing the Snippet in the Header will not work because I don't have the email address yet. Once the email is retrieved, it gets stored in a session variable. I can only initialize after the email has been retrieved. 


The API key will come in a similar fashion, via an environment variable. ie it won't be available until the php code grabs it and sticks it in a session variable. 


Is there any example of initializing in the php code itself? 




Please sign in to leave a comment.

Didn't find what you were looking for?

New post