Skip to content
This repository

Adobe SiteCatalyst Yii Extension

This covers how to install and configure the Adobe SiteCatalyst Yii Extension

Installation

Step 1: Upload the files

The first step is straightforward; simply unzip the files from the latest downloads into your extensions folder. You should now be able to navigate to protected/extensions/TPSiteCatalyst/components/ and see a file called TPSiteCatalyst.php

Optional: Git Submodule

You can also install this as a Git submodule. This can be done with running the following command in the root of your project, where the path to the extensions folder (protected/extensions) might need updating.

git submodule add git://github.com/TagPlanet/yii-analytics-sc.git protected/extensions/TPSiteCatalyst

By using a submodule, this will guarantee you'll have access to the latest version at all times.

Step 2: Add in configuration

Within your configuration files (usually found under /protected/config/) there is the "components" section. Just like your db and cache components, we'll need to add in our own configuration for this. Add in the following code within the components section:

'siteCatalyst' => array(
    'class' => 'ext.TPSiteCatalyst.components.TPSiteCatalyst',
    'rsids' => array(
                    'devsuite1',
                    'devsuite2',
               ),
),

Step 3: (Optional) Add in auto-render

In order for the SiteCatalyst component to automatically render the code in the header, you must have the following two items configured:

  1. Configuration file - within the SiteCatalyst configuration, you must include:
'siteCatalyst' => array(
    'class' => 'ext.TPSiteCatalyst.components.TPSiteCatalyst',
    'rsids' => array(
                    'devsuite1',
                    'devsuite2',
               ),
    'autoRender' => true,
),
  1. Controllers - your controllers must have the following method:
<?php

protected function beforeRender($view)
{
    $return = parent::beforeRender($view);
    Yii::app()->siteCatalyst->render();
    return $return;
}

You can place this either within protected/components/Controller.php (or whichever Controller you are overloading) or within every single one of your controllers. In the event that you already have the method beforeRender within your controllers, simple add in the following line to it, before the return statement:

Yii::app()->siteCatalyst->render();

Configuration Options

This component allows for some flexibility within the configuration section. Below are all of the allowed configuration variables:

class

The TPSiteCatalyst class location. Unless you change the installation directory, this does not need to change.

  • Required: yes
  • Type: string
  • Default: ext.TPSiteCatalyst.components.TPSiteCatalyst
s_account

The RSIDs to be set

  • Required: no
  • Type: string or array (see: Alternate variable syntaxes)
  • Format: varies
  • Default: (none)
s_codeLocation

The location of the s_code JavaScript file. If this is set to an empty string or not set, it is expected that the user will output the JavaScript file on their own.

  • Required: no
  • Type: string
  • Format: URL
  • Default: (none)
namespace

The Omniture namespace (default is s). This is rarely used and you likely don't need to set it.

  • Required: no
  • Type: string
  • Default: s
createObject

Automatically create the s (or whatever namespace) object. If set to false, var s = s_account([RSIDs]); will not be included and it is expected that the s object already exists;

  • Required: no
  • Type: boolean
  • Recommend Setting: true
  • Default: true
autoRender

Automatically render the SiteCatalyst code in the head. If you do set this to true, you will need to update your controller's beforeRender method (see: Optionally adding in auto-render code)

  • Required: no
  • Type: boolean
  • Recommend Setting: true
  • Default: false
autoPageview

Automatically call the s.t() function within the code. By disabling this, you will need to output the s.t() call on your own.

  • Required: no
  • Type: boolean
  • Recommend Setting: true
  • Default: true
renderMobile

This is reserved for rendering a mobile pixel output (still a todo item)

  • Required: no
  • Type: boolean
  • Recommend Setting: false
  • Default: false
renderHead

This is for if you need to move the code up to the head tags or not. This is only in effect when autoRender is enabled. By default, the SiteCatalyst code will be placed at the end of the body tag.

  • Required: no
  • Type: boolean
  • Recommend Setting: false
  • Default: false
Something went wrong with that request. Please try again.