Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JavaScript event tracking code not rendering

Featured Replies

So I'm having a serious problem finding out the best way to solve this problem, I've checked numerous forum posts and tried several versions of the event tracking code for google and nothing seems to work.

Basically I've built a site using the CMS Perch by edgeofmyseat.com and what my client has now asked for is a way of tracking the contact form and register your interest for submissions throughout the site. They don't need to know which page the form is submitted on they just need the overall submission numbers to check against advertising campaigns they run.

I only know basic JavaScript and am really a Designer rather than a Developer but I know enough to implement code from outside sources. Perch works with it's own tags inside templates and I was told to simply paste in this code between the <perch:success></perch:success> tags of the temple for it to render when the form is submitted:

<script type="text/javascript">
_gaq.push(['_trackEvent', 'contact', 'enquiry', 'enquiry form',, false]);
</script>

When I try to verify the Goal in Google analytics I get this and no results even after having left it for 4 days:
This Goal would have a 0% conversion rate based on your data from the past 7 days. Try a different set up.

I figured that simply entering a _gaq.push code into the script tags may not have worked because I would have to call in a function, but even the code below doesn't work.

<script type="text/javascript">
$('#Enquiry-form').submit(function(event) {
var _this = this;
_gaq.push(
// Queue the tracking event
['_trackEvent', 'contact', 'enquiry', 'enquiry form',, false]);
});
</script>

I've also tried to pop in an onsubmit="_gaq.push(['_trackEvent', 'contact', 'enquiry', 'enquiry form',, false]);" into the <perch:form> tag but that doesn't seem to render in the browser.

The form I'm testing this on is here:
http://redcliffehomes.co.uk/contact-us.php

Any ideas would be massively appreciated and let me know if you need any more information.

Edited by emilyjtaylor

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.