How To Create Custom Reports
Contributions to this article were made by ivantage Limited, an Urchin Software Authorized Consultant
To create a custom report:
-
Create new folder for new custom profile type in <Urchin>/lib/custom/profiletypes/ (e.g. <Urchin>/lib/custom/profiletypes/custom_pt)
-
Choose a data map table or define a new one (please refer to Custom Data Maps) and save it in your new folder (e.g. <Urchin>/lib/custom/profiletypes/custom_pt/). Important: don't rename ".dm2" file;
-
Create a new (".rs2") report set file (this file controls navigation and dashboards/reports display) based on <Urchin>/lib/custom/profiletypes/Default/default.rs2.sample and save it (e.g. <Urchin>/lib/custom/profiletypes/custom_pt/custom_rs.rs2).
- Define a new report by adding a new row into the report set file according report set file format described below.
- Link your Profile with custom data map and report set as shown below:
Report set file format
- ID - unique report id:
- C=Category
- D=Data
- M=Menu
- R=Report
- S=Sub Report
- P=Page Report
- B=Dashboard
- RS - Dashboard/Reporting sections:
- 1=exec
- 2=marketer
- 4=webmaster
- 8=advertiser (Urchin 6.6+)
- RR - Report Requirements:
- 1=Software
- 2=Advanced - reports with SP in To-date Lifetime Value, Cross Segment Performance, Visitor History Drilldown, Transaction Details sub-reports require advanced profile capability
- 4=E-commerce (report is displayed for E-commerce profile)
- 8=UTM (report is displayed for UTM profile)
- NTITLE - navigation title (dictionary entry # in /lib/reporting/languages/en-US.txt or custom dictionary)
- ONCOLOR - navigation on color
- OFFCOLOR - navigation off color
- HELP - report help (dictionary entry #)
- NDATA - number of data elements (entries must follow immediately after)
- This field may be used followed by additional sub reports with type D (data)
- CTITLES - column titles (dictionary entry #)
- CTYPES - column type used for formatting
- 10=string
- 11=date/yearmonth
- 12=date
- 20=number
- 21=revenue
- 22=bytes
- 23=time ratio
- 24=ratio
- 25=pct
- 26=time
- 30=total pct
- 40=revenue
- 41=revenue/num
- 42=num/revenue
- TABLE - data table number: (in lib/custom/reporting/profiletypes/custom_pt/datamap.dm2)
- T=total
- TR=transaction
- H=histogram
- V=visitor
- 1-n table
- DXFORMAT - data extraction format
- RF - required field
- RT - report type:
- 1=graph totals
- 2=histogram
- 3=stack
- 4=top
- 5=tree
- 6=directory
- 7=graph-limited
- 8=dot
- 9=click through
- 10=defined funnel
- 11=homepage overlay
- 12=map overlay
- 13=goal verification
- 14=goal path
- 20=kpi date report
- 21=kpi top ten
- 22=trend summary
- 23=conversion summary
- 24=Map Mini
- GTYPES - graph types:
- 1=bar
- 2=line
- 3=pie
- 4=hbar
- 5=fun
- 6=multi-line
- FSEP - field separator
- SP - special options (add bit map numbers):
- 1=totals
- 2=averages
- 4=date compare
- 8=tolowercase
- 16=data over time
- 32=Overlay
- 64=lanugage lookup
- 128=segment
- 256=life time value
- 512=transaction detail
- 1024=Visitor Drilldown
- 2048=term lookup
- SR - special report flag:
- 1=keywords suggestions
- 2=click through
- 3=day parts breakdown
- 4=visitor list
- 5=Map Overlay
- 6=Custom-Use Custom Dictionary
- 7=date comparison
- FNT - filter number filter type:
- 1: =
-
2: >=
-
3: <=
-
4: >
-
5: <
- FNF - filter number field
- FNV - filter value
- FST - filter string type:
- 1=exclude
- 2=include
- FSF - filter string field
- FSX - regular expression string
Below is an example of one reporting row with explanations:
ID |
S1208 |
Sub report with ID 1208 |
DS |
1 |
Executive reporting section |
RR |
8 |
Requires UTM to be enabled |
NTITLE |
162 |
Menu navigation title |
ONCOLOR |
#A2C488 |
Menu hover on color |
OFFCOLOR |
#D0E1C3 |
Menu hover off color |
HELP |
163 |
Help entry |
NDATA |
- |
No data subreports |
CTITLES |
73,2,17,54,55,56,57,74,75 |
Labels of columns for reporting table |
CTYPES |
10,20,24,25,25,25,25,24,41 |
Types of columns for reporting table |
TABLE |
1 |
Data map ID |
DXFORMAT |
$A[$B],11,5/11,28/11,29/11,30/11,31/11,15/11,19/11 |
Data extraction format |
RF |
- |
No required fields |
RT |
4 |
Report type is "top" |
GTYPES |
3,4 |
Two graph types: "pie" and "hbar" |
FSEP |
- |
Field separator is not used |
SP |
1428 |
Special options used: 4 - Date compare; 16 - Data over time; 128 - Segment; 256 - Life time value; 1024 - Visitor Drilldown |
SR |
- |
Regular report |
FNT |
- |
Optional filter is not used |
FNF |
- |
Optional filter is not used |
FNV |
- |
Optional filter is not used |
FST |
- |
Optional filter is not used |
FSF |
- |
Optional filter is not used |
FSX |
- |
Optional filter is not used |
Example: copying a report set
- Copy relevant sections of the ".rs2" file to the bottom of the ".rs2" file. (E.g. copy sections of the ".rs2" file where the "Advertiser" dashboard and few of its reports (Marketing Summary and Campaign Conversion) and few reports of the "Executive" dashboard (Marketing Summary, Geo Map Overlay) are mentioned. Rename dashboard to "Advertiser and Executive" and first report to "A/E Summary" of the copied section.)
- Provide a unique ID for each entry (E.g. provide the "B2400" ID for new dashboard, "R2401", "R2401", "R2402", "R2403", "R2404", "R2405" IDs for new reports.)
- Provide a unique ID for each NTITLE ( E.g. provide the "895" ID for "Advertiser amd Executive" dashboard NTITLE and "896" - for "A/E Summary" report NTITLE.)
- Reference NTITLE from /lib/reporting/languages/en-US.txt. E.g. add two strings in the "en-US.txt" file as illustrated in the following image:
Using the datamap file:
The ".rs2" file references a table ID from the ".dm2" file which in turn references the field list definitions from /lib/reporting/logformats/fieldlist.txt.
The datamap file has column format, consisting of one row per table. Unique ID is used for each table. (Please refer to Custom Data Maps to read more about the ".dm2" file.)