Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

Create pack members

Gaelan Lloyd edited this page Sep 2, 2016 · 1 revision

Laika supports one or more pack members, or tenants, which can be used to represent different clients.

Step 4.1. Create the pack member folder

Browse to the /pack-members/ folder, then duplicate the demo.golaika.com folder. Name the folder with the exact name of the domain that you will be running the Laika dashboard from.

  • You can create as many pack members as you need.
  • Each pack member requires a separate database to store data.

Step 4.2. Obtain Google API credentials

  1. Follow these instructions to obtain the necessary Google API credentials.
  2. Store the resulting .p12 file in the pack member's folder.

Step 4.3. Configure Laika's database credentials

Within each pack member folder is a file called collar.php that contains all of the credentials and customizations needed for that pack member. This file contains the following variables:

Variable Description
LANGUAGE The name of the file in the /translations/ folder that will be used to provide localization support.
DEBUG If TRUE, Laika will provide more verbose output, including error notices from PHP itself.
FETCH_THROTTLE_DELAY The number of seconds to wait between each API call.
DB_NAME The name of the database to interact with.
DB_USER The username for that database.
DB_PASS The password for that database user.
CREDENTIAL_NAME You'll get this from the previous step, it will appear to be a very long email address ending in something similar to iam.gserviceaccount.com.
CREDENTIAL_FILE Provide the path to the .p12 file, omitting the /pack-members/ path. For example, demo.golaika.com/client_secrets.p12.

While this is usually unnecessary, the following variables are provided in the event that you wish to customize the name of the data storage tables within the database:

  • TBL_DATA
  • TBL_SITES
  • TBL_GOALS
  • TBL_METRICS
  • TBL_MENU_GROUPS
  • TBL_MENU_ITEMS

Step 4.4. Protect your pack members

Ensure the security of your pack by:

  • Creating a unique username and password for each pack member database.
  • Preventing Apache from allowing visitors to browse to collar.php or any *.p12 file within the /pack-members/ folders.
  • Restricting file system access to the /pack-members/ files to privileged users only.

Step 4.5. (Optional) Create custom report layouts

If your environment requires a custom report layout, it should be created as a file directly within the pack member folder for that domain.

  • The sample pack member domain demo.golaika.com contains two sample reports that can be used as a starting point for other custom report layouts.

Step 4.6. (Optional) Link dashboard with Google Analytics

Laika's dashboard can be configured to send usage statistics to Google Analytics via Google Tag Manager.

  1. Create a Google Analytics account to store dashboard data.
  2. Link to that account using Google Tag manager.
  3. Set $GTM_ID in collar.php with the ID for the GTM container (just provide the GTM ID, which looks like GTM-XXXXXX).

Clone this wiki locally