-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67166b4
commit 3d0441e
Showing
3 changed files
with
245 additions
and
1 deletion.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
rudder-client-javascript/analytics/tests/html/all_calls.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<html> | ||
<head> </head> | ||
<body> | ||
<h1>Page Loaded</h1> | ||
|
||
<script type="text/javascript"> | ||
analytics = window.analytics = []; | ||
analytics.page = function() { | ||
analytics.push(["page", ...arguments]); | ||
}; | ||
analytics.trackEvent = function() { | ||
analytics.push(["trackEvent", ...arguments]); | ||
}; | ||
analytics.track = function() { | ||
analytics.push(["track", ...arguments]); | ||
}; | ||
analytics.identify = function() { | ||
analytics.push(["identify", ...arguments]); | ||
}; | ||
|
||
analytics.load = function() { | ||
analytics.push(["load", ...arguments]); | ||
}; | ||
|
||
analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a"); | ||
</script> | ||
<script src="browser.js"></script> | ||
|
||
<script type="text/javascript"> | ||
analytics.identify( | ||
"12345", | ||
{ email: "sayan@gmail.com" }, | ||
{ | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
page: { | ||
path: "", | ||
referrer: "", | ||
search: "", | ||
title: "", | ||
url: "" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
} | ||
); | ||
analytics.page( | ||
"ApplicationLoaded", | ||
{ | ||
path: "", | ||
referrer: "", | ||
search: "", | ||
title: "", | ||
url: "" | ||
}, | ||
{ | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
} | ||
); | ||
analytics.track( | ||
"test track event", | ||
{ | ||
category: "", | ||
type: event, | ||
user_actual_role: 'system_admin, system_user' , | ||
user_actual_id: 12345 | ||
}, | ||
{ | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
} | ||
); | ||
</script> | ||
</body> | ||
</html> |
98 changes: 98 additions & 0 deletions
98
rudder-client-javascript/analytics/tests/html/identify.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<html> | ||
<head> </head> | ||
<body> | ||
<h1>Page Loaded</h1> | ||
|
||
<script type="text/javascript"> | ||
analytics = window.analytics = []; | ||
analytics.page = function() { | ||
analytics.push(["page", ...arguments]); | ||
}; | ||
analytics.trackEvent = function() { | ||
analytics.push(["trackEvent", ...arguments]); | ||
}; | ||
analytics.track = function() { | ||
analytics.push(["track", ...arguments]); | ||
}; | ||
analytics.identify = function() { | ||
analytics.push(["identify", ...arguments]); | ||
}; | ||
|
||
analytics.load = function() { | ||
analytics.push(["load", ...arguments]); | ||
}; | ||
|
||
analytics.load("1S2kNlbkMrWLBO79H2eNuEST27I"); | ||
</script> | ||
<script src="browser.js"></script> | ||
|
||
<script type="text/javascript"> | ||
analytics.identify("123456"); | ||
analytics.track("test with identify"); | ||
analytics.identify( | ||
{ | ||
name: "Tintin", | ||
city: "Brussels", | ||
country: "Belgium", | ||
email: "tintin@herge.com" | ||
}, | ||
{ | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
page: { | ||
path: "", | ||
referrer: "", | ||
search: "", | ||
title: "", | ||
url: "" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
}, | ||
() => { | ||
console.log("in identify tintin html"); | ||
} | ||
); | ||
analytics.track("test with traits"); | ||
analytics.reset(); | ||
analytics.track("test after reset", {}, { | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
page: { | ||
path: "", | ||
referrer: "", | ||
search: "", | ||
title: "", | ||
url: "" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
}); | ||
analytics.identify("1234567", | ||
{ | ||
name: "Mickey", | ||
city: "Disneyland", | ||
country: "USA", | ||
email: "mickeymouse@disney.com" | ||
}, | ||
{ | ||
context: { | ||
ip: "0.0.0.0" | ||
}, | ||
page: { | ||
path: "", | ||
referrer: "", | ||
search: "", | ||
title: "", | ||
url: "" | ||
}, | ||
anonymousId: "00000000000000000000000000" | ||
}, | ||
() => { | ||
console.log("in identify mickey html"); | ||
} | ||
); | ||
analytics.track("test after reassignment"); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters