Skip to content

Commit

Permalink
modified test html
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrisha-rudder authored and sayan-rudder committed Sep 30, 2019
1 parent 9aeeadd commit 3dbde54
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 17 additions & 6 deletions rudder-client-javascript/test/dist/test_browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,37 @@ <h1>Page Loaded</h1>
<script type="text/javascript">
analytics = window.analytics = [];
analytics.page = function() {
analytics.push(["page", "value from array"]);
console.log(...arguments)
//analytics.push(["page", arguments[0], arguments[1]]);
var name = arguments[0]
analytics.push(["page", ...arguments]);
};

analytics.load = function(writeKey) {
analytics.push(["load", writeKey]);
};

analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a");
analytics.page();
analytics.page("Wishlist");
//analytics.page();
/* analytics.page("Dashboard", {
"title":"abc",
"url":"http://abc.com"
}); */
</script>

<script src="../dist/browser.js"></script>
<script src="browser.js"></script>

<script type="text/javascript">
//var testObj = new analytics.test();
//testObj.track();
//testObj.page();
//analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a");
analytics.page("test page");
//analytics.track();
//analytics.page("Wishlist");
//analytics.page();
analytics.track('Article Completed', {
title: 'How to Create a Tracking Plan',
course: 'Intro to Analytics',
});
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion rudder-client-javascript/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ class test {
}

}
console.log(JSON.stringify(rudderElement));

//try to first send to all integrations, if list populated from BE
if(this.clientIntegrationObjects){
this.clientIntegrationObjects.forEach(obj => {
//obj.page(...arguments);
console.log("called in normal flow");
obj.page({ rl_message: { rl_properties: { path: "/abc-123" } } }); //test
//obj.page({ rl_message: { rl_properties: { path: "/abc-123" } } }); //test
obj.page(rudderElement)
});
}

Expand Down

0 comments on commit 3dbde54

Please sign in to comment.