Using Virtual Pageviews to track events where there is no destination page.
Setting up goal tracking in analytics should be one of the first steps of any SEO campaign. I am using this code with an SEO campaign where a particular page has a quick contact form that doesn’t post to a thanks page. So there is no destination page to track.
Code on page:
Result in Analytics:
Pageviews for this particular “virtual page” are the number of times people clicked “submit” on the form.
Check out Google’s documentation on virtual pageviews and other tracking customizations.