-
AuthorPosts
-
December 7, 2016 at 8:33 pm #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.December 9, 2016 at 6:03 pm #722542Hey!
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,
YigitDecember 9, 2016 at 6:11 pm #722553Thanks :)
December 13, 2016 at 7:38 am #723573Hi!
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-611668Cheers!
IsmaelDecember 13, 2016 at 4:32 pm #723792Already did that…
Please see attached screenshot (I have 2 contact forms on my site. One for normal contacts, and one for SEO analysis)December 16, 2016 at 2:36 pm #725332Hi,
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,
AndyDecember 16, 2016 at 3:45 pm #725381Hi 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)
December 20, 2016 at 5:20 pm #726674Hi,
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,
YigitDecember 20, 2016 at 5:28 pm #726683Thanks 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? :)December 20, 2016 at 5:30 pm #726684Is it just my normal UA code?
- This reply was modified 7 years, 11 months ago by adferger1.
December 20, 2016 at 5:31 pm #726686Hi!
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,
YigitDecember 20, 2016 at 5:32 pm #726688This one?
December 20, 2016 at 5:33 pm #726689Sorry, but I just got confused when Andy asked for Analytics login. :p
December 20, 2016 at 5:39 pm #726697Hey!
Yes. You should generate another one to insert in other contact form :)
Cheers!
YigitDecember 20, 2016 at 5:45 pm #726699I added it like you suggested, but no events is being tracked.
Am I doing it wrong?December 23, 2016 at 4:42 am #727800Hey!
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!
IsmaelDecember 23, 2016 at 12:16 pm #727884Still nothing :(
December 23, 2016 at 12:48 pm #727904I am using Google Tag manager if that makes any difference?
December 29, 2016 at 2:22 am #728394Hi,
Did you set the goal type as event?
// https://support.google.com/analytics/answer/1033068#Anatomy
// https://developers.google.com/analytics/devguides/collection/analyticsjs/eventsPlease review this article.
// https://support.google.com/analytics/answer/1032415?hl=en
Best regards,
IsmaelFebruary 3, 2017 at 10:26 am #742310Sorry 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?
February 9, 2017 at 3:26 am #744576Hi,
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,
IsmaelFebruary 13, 2017 at 1:55 pm #746386Login information is provided in one of my earlier replies (Dec 16)
February 13, 2017 at 2:05 pm #746396And 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-sendtGoal 2
Category: kontakt-formular
Action: click
Label: formular-sendtAll as described by you….
February 15, 2017 at 6:27 am #747280Hi!
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?
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,
IsmaelFebruary 15, 2017 at 10:24 am #747397Yes 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.
February 15, 2017 at 10:55 am #747409UPDATE:
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 -
AuthorPosts
- The topic ‘Google Analytics event tracking’ is closed to new replies.