Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Track events (Google Analytics)

google; analytics; tracking; event tracking
    • 10 years, 3 months ago Insertech
      Participant

      Expired

      Hi,

      It would be nice to have a Track Event functionality on some elements of the theme such as the buttons.

      Maybe additional fields to fill in in the property of the button. The target is to have the same result as :
      <a onclick=”ga(‘send’, ‘event’, ‘Category’, ‘Action’, ‘Label’);” href=”https://www.example.com/file.pdf”&gt;BUTTON< / a >

      • This topic was modified 10 years, 3 months ago by Insertech.
      • This topic was modified 10 years, 3 months ago by Insertech.
    • 10 years, 3 months ago Ruco
      Keymaster

      We will do our best to make an update for this reason. But for now you can add a new field easy in Element. Go to includes/core/codeless-elements.php. Add this code at line 4390 (make sure that you are in the latest release of Specular 1.2.8)

      array (
      
            'heading' => 'Onclick',
      
            'admin_label' => true,
      
            'param_name' => 'onclick',
      
            'value' => '',
      
            'type' => 'textfield',
      
          ),

      After that go to vc_templates/button.php

      Find this: ‘button_2_link’ => ’#’

      replace with

      
      'button_2_link' => '#',
      'onclick' => ''

      At line 32 add the new tag:

      <a onclick="'.$onclick.'" .....=""></a>

      Best regards!

    • 9 years, 11 months ago Insertech
      Participant

      Expired

      Hi again.

      It seems it doesn’t work with the latest update of Specular/VC…

      Please can you update the directives ?

      Thank you

    • 9 years, 11 months ago Insertech
      Participant

      Expired

      I found a very easy solution !

      Instead of modifying the theme’s core files, and to avoid the problem mentioned above :  just replace the Button element with Raw HTML element, in which we add the Google Analytics code.

      Example :

      <div class=”wpb_content_element button “><span>Téléchargez le guide</span><i class=”moon-arrow-right-5″></i></div>

      :)

    • 9 years, 11 months ago Insertech
      Participant

      Expired

      Another try for the code to appear correctly : (replace @@ with <>)

      @div class=”wpb_content_element button “@@a onclick=”ga(‘send’, ‘event’, ‘Guide’, ‘Download’, ‘Guide Prolongez la vie des ordis’);” class=”btn-bt align-right default” href=”https://www.insertech.ca/wp-content/documents/techno-responsables/insertech-guide-prolonger-vie-ordinateurs.pdf”@@span@Téléchargez le guide@/span@@i class=”moon-arrow-right-5″@@/i@@/a@@/div@

Viewing 4 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password