Name Last Update
..
Readme_en_us.md Loading commit data...
Readme_pt_br.md Loading commit data...

Readme_en_us.md

Trigger


Action

Action to be registered in funifier when execute an event.

Parameters

Attributes (Optional)

  • name: String - name of attribute
  • type: Option - type of attribute
  • function: String - function that dynamically capture the value of the attribute

Example

 return Funifier._$('#idade').val();

Event

Event type to be monitored


Selector

HTML element that will be mapped the event


Page

Page(s) that will be monitoring the event


Pre Script (Optional)

Function performed prior to bind the element

Javascript available variables:

  • element: DOM element
  • trigger: object
    • _id: String
    • name: String
    • actions: Array
    • trigger: String ['click','pageview',...]
    • selector: String
    • page: String
    • pre_script: String
    • post_script: String
    • pre_validation_script: String

Example

Case the element is rendered by ajax, can create a function to call the function "track" manually

Funifier ._ $ ('body'). On ('click', trigger.selector, function () {
    Funifier.track ({action: trigger._id, TRIGGER_TYPE: 'TRIGGER_HTML'});
});
Note 1: As we are traqueando the id of the trigger must inform the trigger type as trigger_html, but the server will interpret the id as the id action.
Note 2: If you do the track manually, you must retonar false in pre validate to avoid unexpected behavior, as more than once traquear the same event.

Pre Validation (Optional)

Validation function performed before to be registered "track" on the funifier. Expect the return as a boolean, case the return is "false", cancel the process and will not be registered the "track" on the Funifier.

Javascript available variables:

  • element: DOM element
  • trigger: object
    • _id: String
    • name: String
    • actions: Array
    • trigger: String ['click','pageview',...]
    • selector: String
    • page: String
    • pre_script: String
    • post_script: String
    • pre_validation_script: String

Example

var value = Funifier._$('# name').val();
if(value.length > 0) {
    // Blank field will not be made the track
    return false;
}
return true;

Post Script (Optional)

Function performed after the track.

Javascript available variables:

  • element: DOM element
  • trigger: object
    • _id: String
    • name: String
    • actions: Array
    • trigger: String ['click','pageview',...]
    • selector: String
    • page: String
    • pre_script: String
    • post_script: String
    • pre_validation_script: String

Example

    alert('action tracked');
Note: In some cases these function can not be performed, depend of the context, for example: redirection of page.

Run only client

If the event is "page view" can be done "Track" manually

Name (Optional)

Name for reference in the studio