Commit 611ab8af634ac5b1e57f6b1664972a931f719ec8
1 parent
9cf7fba0
versões en_us e pt_br
Showing
2 changed files
with
169 additions
and
0 deletions
js/inline/Readme.md renamed to js/inline/Readme_en_us.md
js/inline/Readme_pt_br.md
0 → 100644
| 1 | +# Trigger | |
| 2 | + | |
| 3 | +# Action | |
| 4 | +Action to be triggered to Execultar the event. | |
| 5 | +* Attributes (optional) | |
| 6 | +* Name: string - name attribute | |
| 7 | +* Type: option - type attribute | |
| 8 | +* Function: string - function that will dynamically capture the value of the attribute. | |
| 9 | + | |
| 10 | +### Example | |
| 11 | +``` sh | |
| 12 | +Javascript | |
| 13 | + return Funifier ._ $ ('# age') val ().; | |
| 14 | +``` | |
| 15 | +# Event | |
| 16 | +Event Type to be monitored | |
| 17 | +# Selector | |
| 18 | +Element will be done bind the event. | |
| 19 | +Page (s) that will be monitoring the event. | |
| 20 | +# Pre Script (optional) | |
| 21 | +Function performed prior to bind the element. | |
| 22 | +Available variables: | |
| 23 | +- Element: element gift | |
| 24 | +- Trigger: object | |
| 25 | + * _id: **String** - Required | |
| 26 | + * Name: **String** | |
| 27 | + * Actions:**array** | |
| 28 | + * Trigger: **string ('click', 'pageview' ...)** | |
| 29 | + * Selector: **String** - Required | |
| 30 | + * Page: s**String** - Required | |
| 31 | + * Pre_script: s**String** - Required | |
| 32 | + * Port_script: **String** - Required | |
| 33 | + * Pre_validation_script: **String** - Required | |
| 34 | + | |
| 35 | +### Example | |
| 36 | +If the element to be rendered via ajax, one can create a function to make the track manually. | |
| 37 | +`` `Javascript | |
| 38 | + Funifier ._ $ ('body'). On ('click', trigger.selector, function () { | |
| 39 | + Funifier.track ({action: trigger._id, TRIGGER_TYPE: 'TRIGGER_HTML'}); | |
| 40 | + }); | |
| 41 | +`` ` | |
| 42 | +- 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. | |
| 43 | +- 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. | |
| 44 | + | |
| 45 | +# Pre Validity (optional) | |
| 46 | +- Validation function performed before being made the track, waiting for the return of a boolean if the false seje return will not be made the track. | |
| 47 | +- Available variables: | |
| 48 | +- Element: element gift | |
| 49 | +- Trigger: object | |
| 50 | + * _id: **String** - Required | |
| 51 | + * Name: **String** - Required | |
| 52 | + * Actions: **String** - Required | |
| 53 | + * Trigger: **string ('click', 'pageview' ...)** | |
| 54 | + * Selector: **String** - Required | |
| 55 | + * Page: **String** - Required | |
| 56 | + * Pre_script: **String** - Required | |
| 57 | + * Port_script: string, | |
| 58 | + * Pre_validation_script: string | |
| 59 | + | |
| 60 | +### Example | |
| 61 | +`` `Javascript | |
| 62 | + var value = Funifier ._ $ ('# name') val ().; | |
| 63 | + if (value.length> 0) { | |
| 64 | + // Blank field will not be made the track | |
| 65 | + return false; | |
| 66 | +} | |
| 67 | +return true; | |
| 68 | +`` ` | |
| 69 | +# Post Script (optional) | |
| 70 | +Function performed after the track. | |
| 71 | + | |
| 72 | +- Available variables: | |
| 73 | +- Trigger: object | |
| 74 | + * _id: **String** - Required | |
| 75 | + * Name: **String** - Required | |
| 76 | + * Actions: **array** | |
| 77 | + * Trigger: **string ('click', 'pageview' ...)** | |
| 78 | + * Selector: **String** - Required | |
| 79 | + * Page: **String** - Required | |
| 80 | + * Pre_script: **String** - Required | |
| 81 | + * Port_script: **String** - Required | |
| 82 | + * Pre_validation_script: **String** - Required | |
| 83 | + | |
| 84 | +### Example | |
| 85 | +`` `Javascript | |
| 86 | + alert ('traqueada action'); | |
| 87 | +`` ` | |
| 88 | + | |
| 89 | +- Note: In some cases these function can not be performed, depending on the context, such as in a page redirection. | |
| 90 | + | |
| 91 | +# Run only client | |
| 92 | +- If the event seje "Page View", you can cancel the track on the server of the shares in order to run any script as traquear manually. | |
| 93 | + | |
| 94 | +# Name (Optional) | |
| 95 | +Name for reference in the studio | |
| 96 | +- Variáveis disponíveis: | |
| 97 | +- element : dom element | |
| 98 | +- trigger : object | |
| 99 | + * _id : **String** - Required | |
| 100 | + * name : **String** - Required | |
| 101 | + * actions : **array** | |
| 102 | + * trigger : **string ('click','pageview' ...)** | |
| 103 | + * selector : **String** - Required | |
| 104 | + * page : **String** - Required | |
| 105 | + * pre_script : **String** - Required | |
| 106 | + * port_script : **String** - Required | |
| 107 | + * pre_validation_script : **String** - Required | |
| 108 | + | |
| 109 | +### Example | |
| 110 | +- Caso o elemento seja renderizado via ajax, pode-se criar uma função para fazer o track manualmente. | |
| 111 | + | |
| 112 | +```javascript | |
| 113 | + Funifier._$('body').on('click',trigger.selector,function(){ | |
| 114 | + Funifier.track({action:trigger._id,trigger_type: 'TRIGGER_HTML'}); | |
| 115 | + }); | |
| 116 | +``` | |
| 117 | +- Observação1: Como estamos traqueando o id da trigger devemos informar o trigger type como trigger_html, senão o servidor irá interpretar o id como id da action. | |
| 118 | +- Observação2: Caso você faça o track manualmente, você deve retonar false no pre validate, para evitar comportamentos inesperados, como traquear mais de uma vez o mesmo evento. | |
| 119 | + | |
| 120 | +# Pré Validade (opcional) | |
| 121 | +Função de validação executada antes de ser efetuado o track, espera o retorno de um boolean, caso o retorno seje falso não será feito o track. | |
| 122 | + | |
| 123 | +- Variáveis disponíveis: | |
| 124 | +- element : dom element | |
| 125 | +- trigger : object | |
| 126 | + * _id : **String** - Required | |
| 127 | + * name : **String** - Required | |
| 128 | + * actions : **array** | |
| 129 | + * trigger : **string ('click','pageview' ...)** | |
| 130 | + * selector : **String** - Required | |
| 131 | + * page : **String** - Required | |
| 132 | + * pre_script : **String** - Required | |
| 133 | + * port_script : **String** - Required | |
| 134 | + * pre_validation_script : **String** - Required | |
| 135 | + | |
| 136 | +### Example | |
| 137 | +```javascript | |
| 138 | + var value= Funifier._$('#name').val(); | |
| 139 | + if(value.length>0){ | |
| 140 | + //Campo em branco, não será feito o track | |
| 141 | + return false; | |
| 142 | +} | |
| 143 | +return true; | |
| 144 | +``` | |
| 145 | +# Post Script (opcional) | |
| 146 | +Função executada depois do track. | |
| 147 | +- Variáveis disponíveis: | |
| 148 | +- trigger : object | |
| 149 | + * _id :**String** - Required | |
| 150 | + * name : **String** - Required | |
| 151 | + * actions : **array** | |
| 152 | + * trigger : **string ('click','pageview' ...)** | |
| 153 | + * selector : **String** - Required | |
| 154 | + * page : **String** - Required | |
| 155 | + * pre_script : **String** - Required | |
| 156 | + * port_script : **String** - Required | |
| 157 | + * pre_validation_script : **String** - Required | |
| 158 | + | |
| 159 | +### Example | |
| 160 | +```javascript | |
| 161 | + alert('Acão traqueada'); | |
| 162 | +``` | |
| 163 | +- Observação: Em alguns casos essas função pode não ser executada, dependendo do contexto, como por exemplo em um redirecionamento de pagina. | |
| 164 | + | |
| 165 | +# Run only client | |
| 166 | +- Caso o evento seje "Page View", pode-se cancelar o track no servidor das ações para poder executar algum script como traquear manualmente. | |
| 167 | + | |
| 168 | +# Name (opcional) | |
| 169 | +- Nome para referencia dentro do studio. | |
| 0 | 170 | \ No newline at end of file | ... | ... |