Using Google Analytics Event Tracking

Installing Google Analytics will automatically track all page views, form submissions, and button clicks.

 

Before You Start

  • Add your Google Analytics Tracking ID, visit Using Google Analytics with Strikingly.
  • Remove the Google Analytics tracking code if you add it to your site editor > Settings > Show Advanced > Custom Code.
  • You can find these events without doing anything (we automatically publish the following events): 
    • Form submission - the event is triggered whenever a visitor submits a signup form or contact form. You can find it under category: 'Actions' > action: 'EmailCollected' on Google Analytics.

    • CTA - the event is triggered whenever a visitor clicks a button on your site.

      You can find it under category: 'Action' > action: 'ButtonClick'

mceclip0.png

  • Site.contactForm.submit - this event will be fired when a visitor submits the contact form.
  • Site.button.click - this event will be fired when a visitor clicked on any CTA button.

 

 

Track Custom Events

To add custom events for any other actions on your site, you need to add JavaScript in Settings > Show Advanced > Custom Code > Footer Code. For example:

 

Track Image Clicks

The following code will tell Google Analytics to track all image clicks, by capturing the click event on all ".s-image" elements.

<script>
window._strk = window._strk || [];
_strk.push(function(){
  $('.s-image, .s-media').click(function(){
    var href = $(this).attr('href');
    console.log('Tracking ' + href);
    if (window._gaq) {
      window._gaq.push('_trackEvent', 'Image', 'Click', href);
    }
    if (window.ga) {
      window.ga('send', 'event', 'Image', 'Click', href);
    }
  });
});
</script>

 

Track Third-Party Event

If you want to publish the event to other services such as Mixpanel or Google Ads conversion, you can subscribe to our event topics and pass in a function that responds to the event.

var trackingFunc = function() {
window.edit_page.Event.subscribe('topicName', function(topic, data) {
// put your tracking here
});
}

if (typeof _strk != 'undefined') { _strk.push(['Page.didMount', trackingFunc]); } else { window.runAfterDomBinding.add('custom', trackingFunc); }

 

Note:

  • If you are going to track this event for Google Ads, visit Tracking Conversions on Forms with Google Ads
  • If you have 2 or more forms on your site, there's no way you can differentiate which one the submission has been sent through.

 

 

Feel free to send an email or chat with us if you have more questions!

Have more questions? Submit a request