Commit 15e9cbf563664ea49aebadba164695d0169f7dfc
1 parent
611ab8af
ajustes
Showing
1 changed file
with
116 additions
and
151 deletions
js/inline/Readme_en_us.md
1 | 1 | # Trigger |
2 | 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 ().; | |
3 | +--- | |
4 | +## Action | |
5 | + | |
6 | +Action to be registered in funifier when execute an event. | |
7 | + | |
8 | +### Parameters | |
9 | + | |
10 | +**Attributes (Optional)** | |
11 | + | |
12 | +* **name**: String - name of attribute | |
13 | +* **type**: Option - type of attribute | |
14 | +* **function**: String - function that dynamically capture the value of the attribute | |
15 | + | |
16 | +#### Example | |
17 | + | |
18 | +```javascript | |
19 | + return Funifier._$('#idade').val(); | |
14 | 20 | ``` |
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. | |
21 | +--- | |
71 | 22 | |
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. | |
23 | +## Event | |
90 | 24 | |
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. | |
25 | +Event type to be monitored | |
93 | 26 | |
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. | |
27 | +--- | |
28 | +## Selector | |
29 | + | |
30 | +HTML element that will be mapped the event | |
31 | + | |
32 | +--- | |
33 | + | |
34 | +## Page | |
35 | + | |
36 | +Page(s) that will be monitoring the event | |
37 | + | |
38 | +--- | |
39 | + | |
40 | +## Pre Script (Optional) | |
41 | + | |
42 | +Function performed prior to bind the element | |
43 | + | |
44 | +### Javascript available variables: | |
45 | +- element: DOM element | |
46 | +- trigger: object | |
47 | + * **_id**: String | |
48 | + * **name**: String | |
49 | + * **actions**: Array | |
50 | + * **trigger**: String ['click','pageview',...] | |
51 | + * **selector**: String | |
52 | + * **page**: String | |
53 | + * **pre_script**: String | |
54 | + * **post_script**: String | |
55 | + * **pre_validation_script**: String | |
56 | + | |
57 | +#### Example | |
58 | + | |
59 | +Case the element is rendered by ajax, can create a function to call the function "track" manually | |
111 | 60 | |
112 | 61 | ```javascript |
113 | - Funifier._$('body').on('click',trigger.selector,function(){ | |
114 | - Funifier.track({action:trigger._id,trigger_type: 'TRIGGER_HTML'}); | |
115 | - }); | |
62 | +Funifier ._ $ ('body'). On ('click', trigger.selector, function () { | |
63 | + Funifier.track ({action: trigger._id, TRIGGER_TYPE: 'TRIGGER_HTML'}); | |
64 | +}); | |
116 | 65 | ``` |
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 | |
66 | + | |
67 | +##### 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. | |
68 | +##### 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. | |
69 | + | |
70 | +--- | |
71 | + | |
72 | +# Pre Validation (Optional) | |
73 | + | |
74 | +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. | |
75 | + | |
76 | +### Javascript available variables: | |
77 | +- element: DOM element | |
78 | +- trigger: object | |
79 | + * **_id**: String | |
80 | + * **name**: String | |
81 | + * **actions**: Array | |
82 | + * **trigger**: String ['click','pageview',...] | |
83 | + * **selector**: String | |
84 | + * **page**: String | |
85 | + * **pre_script**: String | |
86 | + * **post_script**: String | |
87 | + * **pre_validation_script**: String | |
88 | + | |
89 | +#### Example | |
90 | + | |
137 | 91 | ```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; | |
92 | +var value = Funifier._$('# name').val(); | |
93 | +if(value.length > 0) { | |
94 | + // Blank field will not be made the track | |
95 | + return false; | |
142 | 96 | } |
143 | 97 | return true; |
144 | 98 | ``` |
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 | |
99 | + | |
100 | +--- | |
101 | + | |
102 | +# Post Script (Optional) | |
103 | + | |
104 | +Function performed after the track. | |
105 | + | |
106 | +### Javascript available variables: | |
107 | +- element: DOM element | |
108 | +- trigger: object | |
109 | + * **_id**: String | |
110 | + * **name**: String | |
111 | + * **actions**: Array | |
112 | + * **trigger**: String ['click','pageview',...] | |
113 | + * **selector**: String | |
114 | + * **page**: String | |
115 | + * **pre_script**: String | |
116 | + * **post_script**: String | |
117 | + * **pre_validation_script**: String | |
118 | + | |
119 | +#### Example | |
120 | + | |
160 | 121 | ```javascript |
161 | - alert('Acão traqueada'); | |
122 | + alert('action tracked'); | |
162 | 123 | ``` |
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. | |
124 | + | |
125 | +##### Note: In some cases these function can not be performed, depend of the context, for example: redirection of page. | |
126 | + | |
127 | +--- | |
164 | 128 | |
165 | 129 | # 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 | 130 | |
168 | -# Name (opcional) | |
169 | -- Nome para referencia dentro do studio. | |
170 | 131 | \ No newline at end of file |
132 | +If the event is "page view" can be done "Track" manually | |
133 | + | |
134 | +# Name (Optional) | |
135 | +Name for reference in the studio | |
171 | 136 | \ No newline at end of file | ... | ... |