Mautic Tracking

This is the PHP snippet of Mautic tracking:

$d = urlencode(base64_encode(serialize(array(
    'page_url'   => 'https://' . $_SERVER[HTTP_HOST] . $_SERVER['REQUEST_URI'],
    'page_title' => $pageTitle,    // Use your website's means of retrieving the title or manually insert it
    'email' => $loggedInUsersEmail // Use your website's means of user management to retrieve the email
))));
echo '<img src="https://example.com/mtracking.gif?d=' . $d . '" style="display: none;" />';

I've added the JS script as an injection, but I need to add the PHP snippet to UNA code so that I can send the email of the logedin users to Mautic for tracking. I need this to code to be enabled on all UNA pages.

Can someone help me with this please

  • 679
  • More
Replies (1)
    • Hello Scholar !

      You may add it to the parseSystemKey method of BxDolTemplate class. Just write in the processing of this variable smth like:

      $oAccount = BxDolAccount::getInstance();

      ...

      case 'my_variable': $oAccount->getEmail();

      Login or Join to comment.