Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1073377

    Hu,

    We must insert a code like this:

    <form action=”URL” method=”post” onsubmit=”gtag(‘event’, ‘Envío solicitud de contacto’, { ‘event_category’: ‘contactar’, ‘event_action’: ‘Botón enviar’});”>

    in the form label of contact form.

    Please, can anyone tell me where can insert this?

    Thanks!

    #1074281

    Hey toniface,

    You’ll need to tweak it in the parent theme, which means you’ll need to do this after doing a theme update.
    Edit wp-content > themes > enfold > framework > php > class-form-generator.php and find this code (line 140):

    $this->output  = '<form action="'.$params['action'].'" method="post" '.$form_data.' class="'.$form_class.' '.$extraClass.'" data-avia-form-id="'.$this->formID.'" '.$redirect.'><fieldset>';

    Hope it helps.

    Best regards,
    Nikko

    #1075605

    Dear Nikko,

    Sorry, I’m really bad for php… I saw the php line you said me

    I need insert this line:

    <form action=”URL” method=”post” onsubmit=”gtag(‘event’, ‘Envío solicitud de contacto’, { ‘event_category’: ‘contactar’, ‘event_action’: ‘Botón enviar’});”>
    How can we do thi? Replace the line you said?

    Thanks

    #1075754

    Hi toniface,

    Try replacing it with this code:

    $this->output  = '<form action="'.$params['action'].'" method="post" onsubmit="gtag(\'event\', \'Envío solicitud de contacto\', { \'event_category\': \'contactar\', \'event_action\': \'Botón enviar\'});" '.$form_data.' class="'.$form_class.' '.$extraClass.'" data-avia-form-id="'.$this->formID.'" '.$redirect.'><fieldset>';

    Hope it helps.

    Best regards,
    Nikko

    #1086022

    Dear Nikko,

    I’ve tried but it doesn’t work. Any other possibility?

    The Enfold documenttion say this:

    What’s the good one?

    Thanks!

    #1086695

    Hi,

    That filter is use to add an attribute to the form submit button.

    Did you set an event goal?

    // https://support.google.com/analytics/answer/1032415?hl=en

    Make sure that you’re using the correct ga library. Are you using this snippet?

    // https://developers.google.com/analytics/devguides/collection/analyticsjs/

    If so, you have to use the ga function instead of gtag.

    // https://developers.google.com/analytics/devguides/collection/analyticsjs/events

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.