Look for the app/design/frontend/{template}/page/html/head.phtml file where {template} is the name of your active Magento template. If this file doesn’t exist, then you will need to check if the app/design/frontend/{template}/default/page/html/head.phtml file exists. It is recommended to place the code before the </head> section of the file.
Note: If the template files mentioned above don't exist, you need to copy the base head.phtml into your custom template. Copy the app/design/frontend/default/page/html/head.phtml file from your default base template to your custom template folder at app/design/frontend/{template}/page/html/head.phtml. You can then open the file and place the chat code before the </head> tag as recommended.
Source: chatstack.com
If you want to add custom PHP code in Magento cms page:
Source: webinse.com
If you don’t receive the email in the next 2 minutes please check your junk folder, and add [email protected] to your safe sender list.