Tutorial: Working with Google Analytics

Create the Google Analytics Account

The first thing you need to do is to create a Google Analytics Account for your domain.

Link Pier with the Google Account

After creating the account, you are given a Javascript code that you should copy in every page. As you already have support for Google Analytics in Pier, you only need the unique identification number that is provided to you. This is a number that looks like UA-1234567-8. Copy that number.

Access the settings of /environment/googleanalytics from your PIer. Paste in the uacct field the number that you just copied.


Make Google Analytics ignore extra parameters

Note: This is not necessary with recent versions, as Pier includes information about the canonical URL automatically with every page.

To make Google Analytics deal better with the dynamic parameters of Seaside (_s and _k), you should tell Google Analytics to disregard them. For this, edit your Google Analytics account, and in the Filters area, choose Add Filter and set it like in the picture below.


For easier copy-paste:

  • the "Field A -> Extract A" value is: ^([^?]*)\?.*$
  • the "Output To -> Constructor" value is: $A1