Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1069854

    Hello,

    i want to track different conversions on my webite.
    how can i track that a user sends me a contact form?

    I have different contact forms and i want to create for each contact form an own conversion tracking?

    As contact form i use the integrated contact form from avia layout architect.

    Whats the best way for tracking and how does it work?

    #1070254

    Who can help me?

    #1070363

    nobody can help me??

    #1070645

    Hi,

    Thank you for contacting us.

    This is not a theme related issue but we can sure point you in the right direction. Please refer to this link for more information.

    Best regards,
    Vinay

    #1071200

    I put this Code in my child theme function

    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){
    	$att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'Anfrage', 'Senden', 'Anfragesenden', testvalue, true]);\"";
    	return $att;
    }

    And i create a goal in analytics with this parameters:

    Event:
    https://www.bilder-upload.eu/bild-0b89c1-1551084192.jpg.html

    The tracking doesn’t work in analytics.
    I send a contact form but the counter doesn’t spring to “1” on 25.02.2019.
    Why?

    #1072472

    Hi,

    (index):243 Uncaught ReferenceError: testvalue is not defined
    at HTMLInputElement.onclick ((index):243)

    That is an error from the console. The “testvalue” variable is not defined or it doesn’t exist, and you need to make sure that the goal value is an integer.

    'Anfragesenden', testvalue, true]);\"";
    

    should be:

    'Anfragesenden', 1, true]);\"";
    

    // https://support.google.com/analytics/answer/1033068

    Best regards,
    Ismael

    #1072552

    Ok i pasted that code snippet in my child theme but the Counter doesn t Jump to 1 after senden a form. 😕

    #1072859

    Hi,

    Looks like you’re using the Google Tag Manager instead of analytics library.

    // https://developers.google.com/analytics/devguides/collection/gtagjs/

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'GA_TRACKING_ID');
    </script>
    

    You have to replace it with the analytics library snippet.

    // https://developers.google.com/analytics/devguides/collection/analyticsjs/

    And replace gaq function with ga.

    // https://developers.google.com/analytics/devguides/collection/analyticsjs/events

    Related thread: https://kriesi.at/support/topic/google-analytics-and-yandex-metrika-goals-for-tracking-contact-form-in-child-the/#post-1063872

    Best regards,
    Ismael

    #1074033

    i am sorry but it did not work…=/
    please check my code in private content box i put in the options of: ENFOLD – Google Dienste

    https://ibb.co/445zXL4

    #1074618

    Hi,

    Thanks for the update.

    The “ga” function should replace “gaq” in the button filter.

    $att = "onclick=\"ga('send', 'event', '_trackEvent', 'Anfrage', 'Senden', 'Anfragesenden', 1, true);\"";
    

    Best regards,
    Ismael

    #1074789

    it doesn’t work =/
    don t know what i am doing wrong.

    #1075256

    Hi,

    I was referring to this filter.

    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){
    	$att = "onclick=\"var _gaq = _gaq || [];_gaq.push(['_trackEvent', 'Anfrage', 'Senden', 'Anfragesenden', testvalue, true]);\"";
    	return $att;
    }
    

    You have to replace the gaq function with ga like so..

    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){
    	$att = "onclick=\"ga('send', 'event', '_trackEvent', 'Anfrage', 'Senden', 'Anfragesenden', 1, true);\"";
    	return $att;
    }

    Best regards,
    Ismael

    #1075396

    i put your code in the functions-enfold.php but the analytics counter does’t jump to 1 if i send a formular.
    please see pics in private content.

    #1076265

    @Ismael Do you know what i am doing wrong?

    #1076336

    Hi,

    This data is being transmitted when you click on the submit button, so the ga function is working properly. (see private field)
    You may need to wait for a while to see the results in your google console. If you don’t see anything, it’s possible that something is wrong with your goal configuration or they don’t coincide with the onclick handler that we created. Unfortunately, we won’t be able to check that without logging in to your gmail account.

    Best regards,
    Ismael

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.