This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Adding Ga tracking in contact form

8 years ago · Last reply by tolba59 8 years ago

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.

Need fast email support? Get SiteOrigin Premium

Replies

4
  1. Alex S Staff 8 years, 4 months ago

    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. tolba59 8 years, 4 months ago

    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. Alex S Staff 8 years, 4 months ago

    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. tolba59 8 years, 4 months ago

    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.

Have a different question or issue?

Start New Thread