-
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
bb6624b
commit 1ba3151
Showing
3 changed files
with
63 additions
and
37 deletions.
There are no files selected for viewing
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
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
40 changes: 40 additions & 0 deletions
40
rudder-client-javascript/analytics/tests/html/test_builder.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,40 @@ | ||
<html> | ||
<head> </head> | ||
<body> | ||
<h1>Page Loaded</h1> | ||
|
||
<script type="text/javascript"> | ||
analytics = window.analytics = []; | ||
var methods = ["load", "page", "track", "identify", "trackEvent", "trackPage", "identifyUser", "reset"]; | ||
for(var i=0;i<methods.length;i++){ | ||
var method = methods[i]; | ||
analytics[method] = function(methodName){ | ||
return function(){ | ||
analytics.push([methodName, ...arguments]); | ||
} | ||
}(method) | ||
} | ||
|
||
analytics.load("1S2kNlbkMrWLBO79H2eNuEST27I"); | ||
</script> | ||
<script src="browser.js"></script> | ||
|
||
<script type="text/javascript"> | ||
analytics.trackEvent( | ||
new analytics.RudderElementBuilder() | ||
.setEvent(analytics.ECommerceEvents.PROMOTION_VIEWED) | ||
.setProperty( | ||
new analytics.PromotionViewedEvent() | ||
.setPromotion( | ||
new analytics.ECommercePromotion() | ||
.setPromotionId("Dummy Promotion 1") | ||
.setCreative("Dummy Creative 1") | ||
) | ||
.build() | ||
.getPropertyMap() | ||
) | ||
.build() | ||
); | ||
</script> | ||
</body> | ||
</html> |