Set Google Analytics Event Label

0

Good evening ..

I'm setting up events for site forms to be monitored by Analytics. But only one I can not do the way I want .. That is to get the label by the select field, for example:

<form  action="envia_orca.php" onSubmit="ga('send', 'event', 'interesse','Solicitar orçamento para', {plano});" method="POST">

<select type="plano" id="plano" name="plano" class="form-control">
    <option value="plano 1">Plano 1</option>
    <option value="plano 2">Plano 2</option>
    <option value="plano 3">Plano 3</option>
</select>

I wanted the GA label to be defined by the "plan" field of the form, how can I do that?

Thank you very much.

    
asked by anonymous 02.01.2017 / 23:14

1 answer

0

Just change 'interesse' to the value of select at the time of submit:

<form  action="envia_orca.php" onSubmit="ga('send', 'event', document.getElementById('plano').value,'Solicitar orçamento para', {plano});" method="POST">
    
04.01.2017 / 17:13