Skip to content

Commit

Permalink
demo prep
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed Sep 30, 2019
1 parent e6ca854 commit a06d4a5
Show file tree
Hide file tree
Showing 9 changed files with 1,785 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"aot": false,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": ["./src/assets/js/node.js"]
"scripts": []
},
"configurations": {
"production": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,39 @@ export class AppComponent {

handleClick(event: Event) {
let analytics = window["analytics"];
analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a");
analytics["page"]();
analytics["track"]();
console.log("===analytics===", analytics);
//analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a");

analytics.identify(
{
name: "Tintin",
city: "Brussels",
country: "Belgium",
email: "tintin@herge.com"
},
() => {
console.log("in identify callback html");
}
);

analytics.page(
"Dashboard",
{
title: "abc",
url: "http://abc.com",
path: "/abc"
},
() => {
console.log("in page callback html");
}
);

analytics.track("Article Started", {
title: "How to Create a Tracking Plan",
course: "Intro to Analytics",
revenue: 10
});

console.log("Click!, event");
}
}
22 changes: 22 additions & 0 deletions rudder-client-javascript/test/angular/todo-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous"
/>

<script type="text/javascript">
analytics = window.analytics = [];
analytics.page = function() {
console.log(...arguments);
analytics.push(["page", ...arguments]);
};
analytics.track = function() {
analytics.push(["track", ...arguments]);
};
analytics.identify = function() {
analytics.push(["identify", ...arguments]);
};

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

analytics.load("1QbNPCBQp2RFWolFj2ZhXi2ER6a");
</script>

<script src="https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js"></script>
</head>
<body>
<app-root></app-root>
Expand Down

0 comments on commit a06d4a5

Please sign in to comment.