Satellite Cheat Sheet

ADVERTISEMENT

SATELLITE CHEAT SHEET
version 1.1
DYNAMICS COMP SCI
LOGIC
JavaScript
What are some other commands for
What are some shorthand JS functions?
Satellite?
Dynamically insert the title and inner text for:
Standard if statement
<a title=”link” href=”/”><p>Hello</p></a>
Enable staging library
if(variable==true){return true;}
title = %this.title%
before:
else{return false;}
localStorage.setItem('sdsat_stagingLibrary', true);
inner text = %target.innerHTML%
variable==true?true:false;
after:
Enable Debug Mode
If object doesn’t exist...
List other variables not in the DOM:
_satellite.setDebug(true)
if (var1 !== null || var1 !==
URL path name = %URI%
undefined || var1 !== '')
Hide My Activity
before:
URL hostname = %hostname%
{var var2 = var1;}
localStorage.setItem('hide_activity', true)
var var2 = var1  || '';
after:
How do you set a custom variable?
Create Safe Console Log
Setting regex variables
In the custom script editor:
_satellite.notify('text to display',
var re = new RegExp(".*","i"),
_satellite.setVar(name, value);
[importance ‘1-5’])
before:
result = re.exec("string");
OR
var result = /.*/i.exec("string");
_satellite.data.customVars.name = value
after:
What are commonly used Regular
Expression methods?
jQuery
To use variables in GA events:
%name%
Method
Action
What are commonly used jQuery functions?
match any character
.
How do you get or set a data element?
in this position
Prefixes
Targeting
Suffixes
In the custom script editor:
^
string begins with...
$(this)
.children(‘li’)
.text()
_satellite.getVar('data element name')
$(‘#id’)
.parents(‘img’)
.html()
$
string ends with...
_satellite.setVar(‘element name’, value);
$(‘.class’)
.closest(‘#id’)
.val()
match 1 character in
[]
To use data elements in GA events:
$(‘div’)
.closest(‘#id’)
.attr(‘href’)
brackets
%data element name%
$(‘div.class’)
define character or
-
number range
How do you read a cookie?
What are advanced jQuery selectors?
match preceding
_satellite.readCookie('cookie')
?
character 0 or 1 times
Selectors
Function
match preceding char.
What are some other functions?
*
$(“[id*=‘contains’]”)
id contains string
0 or more times
Session/Lifetime Pageviews
$(“[class$=‘ends’]”)
class ends w/string
match preceding char. 1
+
_satellite.visitorSessionPagesViewed();
or more times
$(“[id^=‘begins’]”)
id begins w/string
_satellite.visitorLifetimePagesViewed();
match preceding char.
anchors w/title=str
$(“a[title=‘string’]”)
{x}
x times
a w/title doesn’t=str
$(“a[title!=‘string’]”)
match preceding char.
$(‘a:first’)
select first a
{x,y}
b/w x and y times
$(‘ul:last li:last’)
last li of last ul
groups regex parts
()
$(‘ul li:first-child’)
first li of every ul
value on left OR right
|
$(‘:checked’)
all checked boxes
escapes regex chars.
\
$(‘:selected’)
all selected inputs

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go