Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: GA Tracking Code Individual Forms #542640

    Hello Josue,

    I have multiple contact forms for various purposes.
    I use Google Analytics for reporting form submits.
    I may have multiple forms with different purposes and different GA scripts on any one page.
    I may use the same GA tracking code on any form on any different page.

    I can target ALL forms and insert GA script using your code suggestions for “onsubmit” – but I’d like to be able to target separate, individual forms and insert different GA scripts..

    Using the GA “onClick” script you helped with I’m able to track my forms by targeting unique strings used inside the buttons —
    if(in_array( “unique submit button string”, $form_params, TRUE ))

    But, I do sometimes get a false positive because of an errant click. This is why I like the idea of using an “onsubmit” event.

    I know I can use multiple “Thank You” pages as an error proof means of tracking form submittals – but that seems cumbersome.

    I see that your shortcode script appends the Contact Form’s Custom CSS Class to the end of “form class=” in it’s HTML output.

    If I could target that unique Custom CSS Class string in an “if” statement similar to how I’ve done it with my “onClick” script – that would be awesome.

    Sadly, I’ve not been successful.

    Thank you all for an amazing theme and the best support!

    Mark

    in reply to: GA Tracking Code Individual Forms #542116

    Hi All,

    I like your work.

    I’d like to be able to target separate, individual forms with on submit.

    Say, with the Contact Forms’s Custom CSS Class.

    Can you help me out?

    Best;
    Mark

    in reply to: GA Tracking Code Individual Forms #518974

    Hi Elliot,

    Thank you.

    That was the kick-in-the-pants I needed..!

    I find that the $formID is NOT unique to individual forms site-wide – but rather to a form(s) on any one page.

    In my case, it’s better I use UNIQUE text inside the “submit” button – values which can be found in the $form_params array.

    _gaq.push is old school now – traditional ga.js code.

    ga send is today – advanced analytics.js code

    My solution:

    /* To identify $form_parameters AND $formID
     * Insert into child theme functions.php
     * Running this code will "break" your install for visitors - so it's better to do it in a staging environment
     * Comment out code when done
    */
    /*
    add_filter( 'avf_contact_form_submit_button_attr','avia_add_submit_attributes_to_cf', 10, 3 );
    
    function avia_add_submit_attributes_to_cf( $att, $formID, $form_params )
    {
      echo '<pre>';
      echo var_dump( $formID ); //get the ID
      echo '</pre>';
      echo '<pre>';
      echo var_dump( $form_params ); //get all the parameters
      echo '</pre>';
    }
    */
    /* Add onclick event to contact form submit button
     * Insert into child theme functions.php
     * You only need to declare a "unique submit button string" once for it to be used site-wide
     * http://kriesi.at/documentation/enfold/add-onclick-event-to-the-contact-form-submit-button/
     * For Google Analytics goal tracking - advanced analytics.js
     * 10/14/2015
     */
    
    add_filter( 'avf_contact_form_submit_button_attr', 'avia_add_submit_attributes_to_cf', 10, 3 );
    
    function avia_add_submit_attributes_to_cf( $att, $formID, $form_params ) {
    
      //Form on any and all pages
    
      if(in_array( "unique submit button string 1", $form_params, TRUE ))
      {
        $att = "onClick=\"ga( 'send', 'event', { eventCategory: 'xxx', eventAction: 'xxx', eventLabel: 'xxx', eventValue: xx } );\"";
        return $att;
      }
    
      //Special form on page-2 - but I can use it anywhere if I want
    
      if(in_array( "unique submit button string 2", $form_params, TRUE ))
      {
        $att = "onClick=\"ga( 'send', 'event', { eventCategory: 'yyy', eventAction: 'yyy', eventLabel: 'yyy', eventValue: yy } );\"";
        return $att;
      }
    
      //Another additional special form on page-2 - hey... same for me
    
      if(in_array( "unique submit button string 3", $form_params, TRUE ))
      {
        $att = "onClick=\"ga( 'send', 'event', { eventCategory: 'zzz', eventAction: 'zzz', eventLabel: 'zzz', eventValue: zz } );\"";
        return $att;
      }
    
      //Add as many as you need..!
    }
    • This reply was modified 8 years, 5 months ago by bitsoul. Reason: Formatting
    in reply to: Special Heading – H1 Tag – Styled Ampersand #285780

    Yo Yigit…!

    Awesome quick response…

    In my case – H1 tag – Meta Color – Heading Style Modern it is – font-weight: 300;

    Cheers..!

    in reply to: Color Section Not Full-Width Enfold #252473

    Josue,

    Who knew..?
    Commented-out the offending block of code and the “Color Section” now renders as expected.
    Hate the empty <p></p> tags..!
    I’ll need to review this whole issue.

    Say, do you have a suggestions for removing the empty <p></p> tags which are generated from time-to-time?

    Thanks,

    BitSoul

    in reply to: Color Section Not Full-Width Enfold #252453
    This reply has been marked as private.
    in reply to: Color Section Not Full-Width Enfold #252445
    This reply has been marked as private.
    in reply to: Color Section Not Full-Width Enfold #251201

    Hey…

    Check the page …/home-test/.

    You’ll see a block of content titled “What Our Customers Say”.

    This block of content is inside a “Color Section”.

    Notice that the “Color Section” does not extend full page width.

    Adding – #testimonial-color-section-hold .container { width: 100%; } will expand the CONTENT to full page width – not the “Color Section”.

    The thing is this…

    In my experience UNLESS – I have some Avia layout element (say a slider) that extends the full width of the page – as the VERY FIRST element on the page – “Color Sections” will not render as expected.

    I’m able to get-around this behavior (if I don’t want a slider) by adding a “Color Section” as the very first element with a css hack – .avia-section.css-hack { max-height: 1px; min-height: 1px; }

    Later…

    BitSoul

    in reply to: Color Section Not Full-Width Enfold #250267
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)