Set Google Analytics event label

Asked

Viewed 121 times

0

good night..

I am configuring the events of the site’s Forums to be monitored by Analytics. But only one I can’t do the way I want.. Which is to take 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 "flat" field of the form, how can I do this?

Thank you very much..

1 answer

0

All you have to do is change 'interesse' by the value of select at time of Submit:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.