Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setTimeout(function() {
- var t = setInterval(function() {
- if (window.jQuery != undefined) {
- clearInterval(t);
- clearTimeout(timeout);
- var metrics = (function() {
- var inherit = function(child, parent) {
- child.prototype = Object.create(parent.prototype);
- };
- function BaseMetrics() {}
- BaseMetrics.prototype.log = function(attribute) {
- console.log(
- "Action " +
- this.actionName +
- ' com attributo "' +
- attribute +
- '" foi registrada'
- );
- };
- function VisitorMetrics(testName, actionName, shouldLog) {
- this.testName = testName;
- this.actionName = actionName;
- this.shouldLog = shouldLog || false;
- }
- inherit(VisitorMetrics, BaseMetrics);
- VisitorMetrics.prototype.fire = function(attribute) {
- attribute = attribute || "";
- this.shouldLog && this.log(attribute);
- mmsystem.SendUniqueAttribute(
- this.testName,
- this.actionName,
- 1,
- attribute
- );
- };
- function ClickMetrics(actionName, shouldLog) {
- this.actionName = actionName;
- this.shouldLog = shouldLog || false;
- }
- inherit(ClickMetrics, BaseMetrics);
- ClickMetrics.prototype.fire = function(attribute, type) {
- attribute = attribute || "";
- var actionType = type === "postpone" ? "postpone" : "send";
- this.shouldLog && this.log(attribute);
- actions[actionType](this.actionName, 1, attribute);
- };
- return {
- visitor: VisitorMetrics,
- click: ClickMetrics
- };
- })();
- var testName = "Novo Onboarding";
- var shouldLog = false;
- var trigger = {
- funil: new metrics.visitor(
- testName,
- "FluxoConcluido",
- shouldLog
- )
- };
- //Disparar quando for final do fluxo
- trigger.funil.fire("[NOME DO ONBOARDING]");
- //Trocar [NOME DO ONBOARDING] pela versao que o usuario viu
- }
- }, 50);
- var timeout = setTimeout(function() {
- clearInterval(t);
- }, 9000);
- }, 3000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement