Magento integration module

From ClickTale Wiki
Jump to: navigation, search

The Magento Integration Module allows you to record the visitors on your Magento website, ensuring best recording results. The module caches complete versions of each and every page view as it is delivered to the customer. The ClickTale Playback will show you the exact content as seen and interacted with by your visitors.

The module is PHP5 code-based, provided with full sources, that allow better integration of a Magento eCommerce PHP site with ClickTale. Prior to installing the module, please make sure that your host supports PHP5.


License

The module is subject to a permissive license for ClickTale users. Please see the license.txt file in the archive for more information.

Installation Guide

***Please note: Prior to installing the module, please remove the existing tracking code you have on your pages and make sure all other integration methods are disabled***

  1. Download the module from this location.
  2. Unzip the package to your Magento installation directory (sub-directories named app and lib should already be present there). Once unzipped you should have a directory named lib/ClickTale/...
  3. Please make sure to create the lib/ClickTale/Logs and lib/ClickTale/Cache directories (if they do not already exist) and enable them for writing (CHMOD 777)
  4. Generate the ClickTale tracking code you wish to use on your pages.
  5. Paste both parts of the tracking code into the lib/ClickTale/ClickTaleScripts.xml file.
  6. Add the cache fetching redirection code, according to your tracking code type:     (How can I find which code type my project is using?)

  7. If you have code type Atlas, click 'Expand' below to see the instructions for placing your code. Click 'Collapse' to close the section.    (How can I find which code type my project is using?)

     
    Add the line:
    var ClickTaleFetchFrom="%FetchFromUrl%";

    Just before the line

       if(typeof ClickTale=='function') ClickTale([your project parameters]);

    Please note: You do not need to change "%FetchFromUrl%" to a specific URL. It will be replaced automatically during the rendering process, with a value dependent on the page being recorded.
    Your xml file should now look like this (Please do not copy and paste this part):

    <?xml version="1.0" encoding="utf-8" ?>
     
    <scripts>
    <script name="Top" DoNotReplaceCondition = "&lt;!-- ClickTale Top part --&gt;">
    <![CDATA[
       <!-- ClickTale Top part -->
       <script type="text/javascript">
       var WRInitTime=(new Date()).getTime();
       </script>
       <!-- ClickTale end of Top part -->]]>
    </script>
    <script name="Bottom" DoNotReplaceCondition = "&lt;!-- ClickTale Bottom part --&gt;">
    <![CDATA[
       <!-- ClickTale Bottom part -->
    <div id="ClickTaleDiv" style="display: none;"></div>
    <script type='text/javascript'>
    document.write(unescape("%3Cscript%20src='"+
     (document.location.protocol=='https:'?
      'https://clicktalecdn.sslcs.cdngc.net/www/':
      'http://cdn.clicktale.net/')+
     "WRe0.js'%20type='text/javascript'%3E%3C/script%3E"));
       </script>
       <script type="text/javascript">
       var ClickTaleSSL=1;
       var ClickTaleFetchFrom="%FetchFromUrl%";
       if(typeof ClickTale=='function') ClickTale([your project parameters]);
       </script>
       <!-- ClickTale end of Bottom part -->
    ]]>
    </script>
    </scripts>



    If you have code type Balkan, click 'Expand' below to see the instructions for placing your code. Click 'Collapse' to close the section.

     
    Add the line:
    var ClickTaleFetchFrom="%FetchFromUrl%";

    Just before the line

    document.write(unescape("%3Cscript%20src='"+

    Please note: You do not need to change "%FetchFromUrl%" to a specific URL. It will be replaced automatically during the rendering process, with a value dependent on the page being recorded.
    Your xml file should now look like this (Please do not copy and paste this part):

    <?xml version="1.0" encoding="utf-8" ?>
     
    <scripts>
    <script name="Top" DoNotReplaceCondition = "&lt;!-- ClickTale Top part --&gt;">
    <![CDATA[
       <!-- ClickTale Top part -->
       <script type="text/javascript">
       var WRInitTime=(new Date()).getTime();
       </script>
       <!-- ClickTale end of Top part -->]]>
    </script>
    <script name="Bottom" DoNotReplaceCondition = "&lt;!-- ClickTale Bottom part --&gt;">
    <![CDATA[
    <!-- ClickTale Bottom part -->
    <script type='text/javascript'>
    // The ClickTale Balkan Tracking Code may be programmatically customized using hooks:
    //
    // function ClickTalePreRecordingHook() { /*place your customized code here*/ }
    //
    // For details about ClickTale hooks, please consult the Wiki page http://wiki.clicktale.com/Article/Customizing_code_version_2
     
    var ClickTaleFetchFrom="%FetchFromUrl%";
    document.write(unescape("%3Cscript%20src='"+
    (document.location.protocol=='https:'?
    "https://clicktalecdn.sslcs.cdngc.net/wwwXX/ptc/xxxxxx-xxxx-xxxx-xxx-xxxxxx.js":
    "http://cdn.clicktale.net/wwwXX/ptc/xxxxxx-xxxx-xxxx-xxx-xxxxxx.js")+"'%20type='text/javascript'%3E%3C/script%3E"));
    </script>
    <!-- ClickTale end of Bottom part -->
    ]]>
    </script>
    </scripts>



    PLEASE NOTE: This is how the code looks like in a text editor. In a browser, "&lt;" will be converted to "<" and "&gt;" will become ">"

    PLEASE ALSO NOTE: This code sample relates to both HTTP and HTTPS page tracking. Your account may or may not have the option to record HTTPS pages. Please check and consult with your account manager, if you need assistance.

  8. Make sure to "Save Configuration" in the Magento Admin Panel to enable the ClickTale Integration Module.
    Go to: System--> Configuration --> Advanced --> Advanced (button) --> click "Save config"

Please note: Magento’s OnePage/OneStep Checkout uses JavaScript panels which ClickTale does not support by default. Please visit Magento_Onepage_integration_code to enable support for these panels.

Troubleshooting

To perform basic troubleshooting, navigate to the page located at www.yourdomain.com/lib/ClickTale/Install/index.php, similar to the PHP Integration module, any items marked red should be corrected for trouble-free recording. Commonly the Cache and Logs folders should be manually given write permissions using CHMOD.