Step 1:
Visit CometChat Administration Panel->Click on Add CometChat tab and fill the following details:

a) Site URL: Enter your domain name without http

b) Platform: Select ‘mooSocial’ from the drop-down

Click on ‘Save’ button.


Step 2:
a) Copy the code given below and add the copied code in your default.ctp file just before the </head> tag. This file is generally present at /app/View/Themed/THEMENAME/Layouts/default.ctp

Note: If your active theme is default or any other theme with base as default theme, then default.ctp will be located in directory ‘/app/View/Layouts/’

    $chat_name = $chat_link = $chat_avatar = '';
    $chat_id = $this->Session->read('uid');
    if(!empty($chat_id) && isset($cuser)) {
        $chat_name = $cuser['name'];
        $chat_link = FULL_BASE_URL.$this->Moo->getProfileUrl( $cuser );
        $chat_avatar = FULL_BASE_URL.$this->Moo->getUserPicture($cuser['avatar']);
var chat_name = "<?php echo $chat_name;?>";
var chat_id = "<?php echo $chat_id;?>";
var chat_avatar = "<?php echo $chat_avatar;?>";
var chat_link = "<?php echo $chat_link;?>";

Now, visit “Add CometChat” tab in CometChat Administration Panel and copy the HTML code displayed in the section ”Add CometChat as a floating bar to your site” and paste it after the above code.


b) To embed CometChat to your site, visit “Add CometChat” tab and copy the HTML code displayed in the section “Embed CometChat in your site page” and paste it to the page where you want to embed CometChat.


Not finding what you need?

The CometChat team is here to help!