Skip to content

Commit

Permalink
Formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Sep 2, 2021
1 parent c5234bb commit 79f2988
Showing 1 changed file with 112 additions and 101 deletions.
213 changes: 112 additions & 101 deletions tests/SampleEventsTest.Html
Original file line number Diff line number Diff line change
@@ -1,116 +1,127 @@
<html>
<head>
<script>
rudderanalytics = window.rudderanalytics = [];
var methods = [
"load",
"page",
"track",
"identify",
"alias",
"group",
"ready",
"reset",
"getAnonymousId",
"setAnonymousId"
];

for (var i = 0; i < methods.length; i++) {
var method = methods[i];
rudderanalytics[method] = function (methodName) {
return function () {
rudderanalytics.push([methodName].concat(Array.prototype.slice.call(arguments)));
};
}(method);
}
rudderanalytics.load("1weqc5iqxRkpaUXHgDgYo3g34mg", "http://localhost:8080", { logLevel: "DEBUG"});
rudderanalytics.page(
"Home",
"Cart Viewed",
{
path: "",
referrer: "",
search: "",
title: "",
url: "",
},
() => {
console.log("in page call");
});
<head>
<script>
rudderanalytics = window.rudderanalytics = [];
var methods = [
"load",
"page",
"track",
"identify",
"alias",
"group",
"ready",
"reset",
"getAnonymousId",
"setAnonymousId",
];

rudderanalytics.track(
"test track event 1",
{
revenue: 30,
currency: 'USD' ,
user_actual_id: 12345
},
() => {console.log("in track call 1");}
);
for (var i = 0; i < methods.length; i++) {
var method = methods[i];
rudderanalytics[method] = (function (methodName) {
return function () {
rudderanalytics.push(
[methodName].concat(Array.prototype.slice.call(arguments))
);
};
})(method);
}
rudderanalytics.load(
"1weqc5iqxRkpaUXHgDgYo3g34mg",
"http://localhost:8080",
{ logLevel: "DEBUG" }
);
rudderanalytics.page(
"Home",
"Cart Viewed",
{
path: "",
referrer: "",
search: "",
title: "",
url: "",
},
() => {
console.log("in page call");
}
);

rudderanalytics.track(
"test track event 2",
{
revenue: 45,
currency: 'INR' ,
user_actual_id: 333
},
() => {console.log("in track call 2");}
);
rudderanalytics.track(
"test track event 1",
{
revenue: 30,
currency: "USD",
user_actual_id: 12345,
},
() => {
console.log("in track call 1");
}
);

rudderanalytics.track(
"test track event 3",
{
revenue: 10003,
currency: 'EUR' ,
user_actual_id: 5678
},
() => {console.log("in track call 3");}
);
rudderanalytics.track(
"test track event 2",
{
revenue: 45,
currency: "INR",
user_actual_id: 333,
},
() => {
console.log("in track call 2");
}
);

// TODO: Call other APIs here
</script>
rudderanalytics.track(
"test track event 3",
{
revenue: 10003,
currency: "EUR",
user_actual_id: 5678,
},
() => {
console.log("in track call 3");
}
);

<!-- ============ V1 ============ -->
<!-- <script src="https://cdn.rudderlabs.com/rudder-analytics.min.js"></script> -->
<!-- <script src="https://cdn.rudderlabs.com/v1/rudder-analytics.min.js"></script> -->
<!-- ============ V1 ============ -->
// TODO: Call other APIs here
</script>

<!-- ============ V1 ============ -->
<!-- <script src="https://cdn.rudderlabs.com/rudder-analytics.min.js"></script> -->
<!-- <script src="https://cdn.rudderlabs.com/v1/rudder-analytics.min.js"></script> -->
<!-- ============ V1 ============ -->

<!-- ============ V3 ============ -->
<!-- ============ CDN ============ -->
<!-- Prod -->
<!-- MINIFIED -->
<script src="https://cdn.rudderlabs.com/v3/rudder-analytics.min.js"></script>
<!-- ============ V3 ============ -->
<!-- ============ CDN ============ -->
<!-- Prod -->
<!-- MINIFIED -->
<script src="https://cdn.rudderlabs.com/v3/rudder-analytics.min.js"></script>

<!-- UNMINIFIED -->
<!-- <script src="https://cdn.rudderlabs.com/v3/rudder-analytics.js"></script> -->
<!-- UNMINIFIED -->
<!-- <script src="https://cdn.rudderlabs.com/v3/rudder-analytics.js"></script> -->

<!-- Dev -->
<!-- MINIFIED -->
<!-- <script src="https://ddim5kcy73icz.cloudfront.net/v2/rudder-analytics.min.js"></script> -->
<!-- Dev -->
<!-- MINIFIED -->
<!-- <script src="https://ddim5kcy73icz.cloudfront.net/v2/rudder-analytics.min.js"></script> -->

<!-- UNMINIFIED -->
<!-- <script src="https://ddim5kcy73icz.cloudfront.net/v2/rudder-analytics.js"></script> -->
<!-- UNMINIFIED -->
<!-- <script src="https://ddim5kcy73icz.cloudfront.net/v2/rudder-analytics.js"></script> -->

<!-- ============ S3 ============ -->
<!-- MINIFIED -->
<!-- <script src="https://js-sdk-staging-test.s3.amazonaws.com/v2/rudder-analytics.min.js"></script> -->
<!-- ============ S3 ============ -->
<!-- MINIFIED -->
<!-- <script src="https://js-sdk-staging-test.s3.amazonaws.com/v2/rudder-analytics.min.js"></script> -->

<!-- UNMINIFIED -->
<!-- <script src="https://js-sdk-staging-test.s3.amazonaws.com/v2/rudder-analytics.js"></script> -->
<!-- ============ V3 ============ -->
<!-- UNMINIFIED -->
<!-- <script src="https://js-sdk-staging-test.s3.amazonaws.com/v2/rudder-analytics.js"></script> -->
<!-- ============ V3 ============ -->

<!-- ============ LOCAl ================= -->
<!-- Local MINIFIED -->
<!-- <script src="../dist/rudder-analytics.min.js"></script> -->

<!-- ============ LOCAl ================= -->
<!-- Local MINIFIED -->
<!-- <script src="../dist/rudder-analytics.min.js"></script> -->

<!-- Local UNMINIFIED -->
<!-- <script src="../dist/rudder-analytics.js"></script> -->
<!-- ============ LOCAl ================= -->
</head>
<body>
<h1>Page Loaded</h1>
</body>
</html>
<!-- Local UNMINIFIED -->
<!-- <script src="../dist/rudder-analytics.js"></script> -->
<!-- ============ LOCAl ================= -->
</head>
<body>
<h1>Page Loaded</h1>
</body>
</html>

0 comments on commit 79f2988

Please sign in to comment.