Cheatography
https://cheatography.com
A list of Regular Expression functionality supported by Google Analytics - Cheat Sheet Description
This is a draft cheat sheet. It is a work in progress and is not finished yet.
RegExp - Anchors
^ |
Start of line |
$ |
End of line |
RegExp | Character Classes
\s |
White space character |
\S |
Non-white space character |
\d |
Digit character |
\D |
Non-digit character |
\w |
Word |
\W |
Non-word (e.g. punctuation, spaces) |
RegExp | Meta Char (must be esc.)
^ |
[ |
] |
$ |
( |
) |
. |
{ |
} |
* |
+ |
? |
\ |
| |
- |
RegExp | GA Filter group accessors
$Ax |
Access group x in field A (e.g. $A1) |
$Bx |
Access group x in field B (e.g. $B1) |
GUA | URL Collect Parameters - Main Parameters
a |
Random number used to link Google Analytics to Adsense (currently not working) |
# |
cid |
Client ID number |
* |
de |
Document Encoding type |
dl |
The Document Location |
dt |
Document Title |
fl |
FLash version |
je |
Java Enabled? (1=yes, 0=no) |
ni |
Non-Interaction hit type (set as true or '1' in code. Shows as 1 or 0 in parameters) |
_s |
hit Sequence - increments each time an event (inc pageview) |
sd |
Screen Depth |
sr |
Screen Resolution |
t |
the Type of tracking call this is (e.g. pageview, event) |
* |
tid |
Tracking ID (your UA number) |
* |
_u |
Verification code generated by GA analytics.js |
+ |
ul |
User Language code |
_v |
SDK Version number |
v |
protocol Version |
* |
vp |
View Port size (browser window visible area) |
z |
cache buster |
# equivalent of the classic analytics utmhid parameter
* must be present on EVERY call to be accepted by GA servers.
+ see http://stackoverflow.com/questions/26849042/u-parameter-in-universal-google-analytics-collect-hits for full explanation
|
|
RegExp - Quantifiers
* |
Zero or more (greedy) |
*? |
Zero or more (lazy) |
+ |
One or more (greedy) |
+? |
One or more (lazy) |
? |
Zero or one (greedy) |
?? |
Zero or one (lazy) |
{X} |
Exactly X (e.g. 3) |
{X,} |
X or more, (e.g. 3) |
{X, Y} |
Between X and Y (e.g. 3 and 5) (lazy) |
GUA - Events Parameters
ea |
Event Action |
ec |
Event Category |
el |
Event Category |
ev |
Event Value |
You will only see any of these when t (type) = event
GUA - Timing Parameters
utc |
User Timing Catergory (not universal coordinated time) |
utv |
User Timing Variable name |
utt |
User Timing Time |
utl |
User Timing Label |
plt |
Page Load Time |
dns |
DNS time |
pdt |
Page Download Time |
rrt |
Redirect Response Time |
tcp |
TCP connect time |
srt |
Server Response Time |
exd |
EXception Description |
exf |
is EXception Fatal? |
GUA - Campaign Variable Parameters
cn |
Campaign Name |
cs |
Campaign Source |
cm |
Campaign Medium |
ck |
Campaign Keyword |
cc |
Campaign Content |
ci |
Campaign Id |
glcid |
Google adwords ID |
dclid |
google Display ads ID |
To register any campaign variables (c*) you MUST populate Campaign Source AND Campaign Medium as a minimum.
GUA - Custom Parameters
cd1...cdN |
Custom Dimension value with index number (free=1 to 20, premium=1 to 200) |
cm1...cmN |
Custom Metric value with index number (free=1 to 20, premium=1 to 200) |
cg1...cgN |
Content Grouping value with index number (1 to 5) |
GUA - Override Parameters
dh |
Document Host name override |
dp |
Document Path - used when overriding the standard page name |
ua |
User Agent override |
uip |
User IP override |
cd |
sCreen name - mainly used in app tracking |
linkid |
Link ID of a clicked DOM element |
|
|
RegExp | Ranges and Groups
. |
Any character |
(a|b) |
a or b (case sensitive) |
(...) |
Group, e.g. (keyword) |
(?:...) |
Passive group, e.g. (?:keyword) |
[abc] |
Range (a or b or c) |
[^abc] |
Negative range (not a or b or c) |
[A-Z] |
Uppercase letter between A and Z |
[a-z] |
Lowercase letter between a and z |
[0-7] |
Digit between 0 and 7 |
RegExp | Sample Patterns
^/directory/(.*)
Any page URLs starting with /directory/
(brand\s*?term)
Brand term with or without whitespace between words
brand\s+[cf]
Key phrases beginning with 'brand' and the second word not starting with c or f
\.aspx$
URLs ending in '.aspx'
ORDER\-\d{6}
"ORDER-" followed by a six digit ID
(?:\?|&)utm=([^&$]+)
Value of 'utm' querystring parameter |
Note: Sample Patterns Text - Description
GUA - eCommerce Parameters
cu |
CUrrency that the transaction takes place in |
in |
Item Name |
ic |
Item Code (sku) |
ip |
Item Price (per unit) |
iq |
Item Quantity |
iv |
Item Variation (normally category) |
ta |
Transaction Affiliation |
ti |
Transaction Identification number |
tr |
Transaction Revenue value |
ts |
Transaction Shipping value |
tt |
Transaction Tax value |
You will only see these when t (Type) = transaction or item.
GUA - App Tracking Parameters
aid |
Application ID |
aiid |
Application Installer ID |
an |
Application Name |
av |
Application Version |
ht |
HiT sequence number |
GUA - Other Parameters
aip |
Anonymize IP (see note below) |
jid |
JoinID (binding your GA cookie to DoubleClick cookie) |
qt |
Queue Time (for collecting offline data) |
sc |
Session Control |
uid |
User ID (known uid as opposed to cid) |
aip: The value of this parameter can be absolutely anything to cause the IP to be anonymized. This includes a blank value. $aip=, $aip=0, &aip=1 will all cause anonymity.
GUA - Google Experiments Parameters
xid |
Experiment ID |
xvar |
Experiment VARiant |
GUA - Social Tracking Parameters
sn |
Social Network |
sa |
Social Action |
st |
Social action Targt (normally a url) |
|