Home>Support>Adding Ga tracking in contact form

Adding Ga tracking in contact form

Hi,

There was a question about how to add the GA tracking to the button click in SO contact form, and the answer was to add the conversion tracking directly to the success message, does this mean something like this:

<p onClick="ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');>Thanks for contacting us. We'll get back to you shortly.

Or there is another way to track onClick event?

Thanks for your support
Best Regards
Eslam

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 3 days ago Alex S
    Hi, I Work Here

    Hi Eslam,

    No. That would still require the user to click the paragraph (which they’re unlikely to ever do). You should trigger the code directly instead. Something like this:

    <script>
    ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');
    </script>
    

    Please note that you’ll need to only use the text tab as the visual tab will break the above HTML/JavaScript.

  2. 6 years, 11 months ago tolba59

    Hi Alex,

    Thanks for your reply, Just a clarification you now mean that the button code will be something like this?

    <div class="sow-submit-wrapper sow-submit-styled">
    			<input type="submit" value="Download Now"
    				   class="sow-submit">
    				   <script>
    		ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');
    				</script>
    		</div>

    Thanks for your support :)

  3. 6 years, 11 months ago Alex S
    Hi, I Work Here

    Hi Eslam,

    No. Please open the SiteOrigin Contact Form and open the Settings settings group and add the above JavaScript to the Success Message editor – be sure to add it to the Text mode.

  4. 6 years, 11 months ago tolba59

    Hi Alex,

    Thanks a lot for your reply, understood now :)
    Keep up the great work SO people :)

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More