Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #721696

    Can someone help me with how to setup event tracking for my 2 contact forms?
    (Seperate events)
    I found the documentation on the subject, but it doesn´t really help me much.

    #722542

    Hey!

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    Login credentials include:

    • The URL to the login screen.
    • A valid username (with full administration capabilities).
    • As well as a password for that username.
    • permission to deactivate plugins if necessary.

    Also post your tracking code

    Best regards,
    Yigit

    #722553

    Thanks :)

    #723573

    Hi!

    We can’t setup the tracking event in the WP dashboard. We will also need your gmail account because the tracking goal has to be created in the google webmaster tools.

    // https://kriesi.at/support/topic/tracking-contact-form/#post-565219
    // https://kriesi.at/support/topic/google-goal-tracking/#post-611668

    Cheers!
    Ismael

    #723792

    Already did that…
    Please see attached screenshot (I have 2 contact forms on my site. One for normal contacts, and one for SEO analysis)

    #725332

    Hi,

    this doesn’t help us. Anyway, does it work for you when using a default WP theme instead? cause I guess this is not a theme related issue, but more of a general WP one and in this case it’s best to ask general WP support about it. However, you could still provide us gmail account.

    Best regards,
    Andy

    #725381

    Hi Andy.
    I dont really know what you mean by issue? I dont have any issue.
    All I want is Event tracking for my 2 contact forms, and I dont really know how to set that up.
    All I am asking is if someone can help me or show me how to do it.

    I have attached the login to my Google Analytics like you asked (I am using the Master View)

    #726674

    Hi,

    Please add following code to Functions.php file in Appearance > Editor

    
    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){
      if(is_page(85)){
      $att = "onclick=\"_gaq.push(['_trackPageview', '/VP/XXX/XXX']);\"";
      }
      elseif(is_page(87)){
      $att = "onclick=\"_gaq.push(['_trackPageview', '/VP/XXX/XXX']);\"";
      }
      return $att;
    }

    First part is for your “kontakt” page and the second one is for “Gratis SEO Analyse” page. You need to edit the code and replace “/VP/XXX/XXX” with two different tracking codes. We cannot help you further as long as you do not provide those tracking codes to us.

    Best regards,
    Yigit

    #726683

    Thanks a lot for your reply Yigit.
    So there really wasn’t any need for me to post my login details for Analytics, was there? :)
    Can you tell me here I locate those tracking codes? :)

    #726684

    Is it just my normal UA code?

    • This reply was modified 7 years, 11 months ago by adferger1.
    #726686

    Hi!

    We needed tracking codes, as i requested in my very post as well – https://kriesi.at/support/topic/google-analytics-event-tracking-2/#post-722542 :)

    Please refer to this post – https://support.google.com/analytics/answer/1032385?hl=en

    Regards,
    Yigit

    #726688

    This one?

    #726689

    Sorry, but I just got confused when Andy asked for Analytics login. :p

    #726697

    Hey!

    Yes. You should generate another one to insert in other contact form :)

    Cheers!
    Yigit

    #726699

    I added it like you suggested, but no events is being tracked.
    Am I doing it wrong?

    #727800

    Hey!

    Please replace the code with this.

    add_filter('avf_contact_form_submit_button_attr','avf_contact_form_submit_button_attr_track_mod', 10, 3);
    function avf_contact_form_submit_button_attr_track_mod($att, $formID, $form_params){
      	if (is_page(85)) {
        	$att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'kontakt-formular', 'click', 'formular-sendt', '', true]);\"";
    	} elseif (is_page(87)) {
    	    $att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'seo-analyse', 'click', 'analyseformular-sendt', '', true]);\"";
    	} else {
    	    $att = "";
    	}
    
      	return $att;
    }

    Cheers!
    Ismael

    #727884

    Still nothing :(

    #727904

    I am using Google Tag manager if that makes any difference?

    #728394
    #742310

    Sorry for the late reply, but I was hung up on some other job.
    Yes I have added it as a goal as well…

    Is it just not possible to make this theme track events?

    #744576

    Hi,

    Is it just not possible to make this theme track events?

    It’s possible but you have to configure the goals correctly. If you can provide the login details for your gmail account, we will setup the tracking goal.

    Best regards,
    Ismael

    #746386

    Login information is provided in one of my earlier replies (Dec 16)

    #746396

    And just to sum it all up.
    This code has been added to my functions.php:

    add_filter('avf_contact_form_submit_button_attr','avf_contact_form_submit_button_attr_track_mod', 10, 3);
    function avf_contact_form_submit_button_attr_track_mod($att, $formID, $form_params){
      	if (is_page(85)) {
        	$att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'kontakt-formular', 'click', 'formular-sendt', '', true]);\"";
    	} elseif (is_page(87)) {
    	    $att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'tilbud', 'click', 'tilbud-sendt', '', true]);\"";
    	} else {
    	    $att = "";
    	}
    
      	return $att;
    }

    And I have set up 2 goals in Analytics:

    Goal 1
    Category: tilbud
    Action: click
    Label: tilbud-sendt

    Goal 2
    Category: kontakt-formular
    Action: click
    Label: formular-sendt

    All as described by you….

    #747280

    Hi!

    I tried to login to your email account but it requires a phone verification. Since, I don’t have a direct access to your phone, please provide the phone number.

    Confirm the phone number you provided in your security settings: •• •• •• 43

    In the “kontact” page, if you inspect the “send” button, the onclick attribute value is being applied correctly. However, I think it’s not working because the tracking code has been updated. Are you using the “Universal Analytics” tracking code?

    // https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs#snippet

    Please replace the function with this:

    add_filter('avf_contact_form_submit_button_attr','avf_contact_form_submit_button_attr_track_mod', 10, 3);
    function avf_contact_form_submit_button_attr_track_mod($att, $formID, $form_params){
      	if (is_page(85)) 
    	{
        	$att = "onclick=\"ga('send', 'event', 'kontakt-formular', 'click', 'formular-sendt');\"";
    	} 
    	elseif (is_page(87)) 
    	{
    	    $att = "onclick=\"ga('send', 'event', 'tilbud', 'click', 'tilbud-sendt');\"";
    	} 
    	else 
    	{
    	    $att = "";
    	}
    
      	return $att;
    }
    

    Regards,
    Ismael

    #747397

    Yes I am using universal analytics. :)
    I have disabled the phone verification now, and white-listed your computer :)

    I have also replaced the code in Functions.php with the new code you provided.

    #747409

    UPDATE:

    I solved the problem. Since I am using Google Tag Manager to add my Google Universal Analytics code to the site, I also need to add the event tag en Google Tag Manager.
    If anyone else is having this problem you can follow this guide:
    https://support.google.com/analytics/answer/6164470?hl=en

Viewing 26 posts - 1 through 26 (of 26 total)
  • The topic ‘Google Analytics event tracking’ is closed to new replies.