-
AuthorPosts
-
March 10, 2016 at 10:45 pm #596594
Hi Guys,
If I add the code below to the field ‘advanced settings’ in contact form 7, form submissions are tracked in analytics. Is there a way to add this code to an enfold contact form? I’d prefer to add it to all enfold contact forms at once, so that every enfold contact form is set as a goal.
Kind regards.
March 15, 2016 at 1:01 am #598070Hi lucasvrooij!
Please refer to this post – http://kriesi.at/documentation/enfold/add-onclick-event-to-the-contact-form-submit-button/
Best regards,
YigitMarch 29, 2016 at 7:08 pm #604753Hi Yigit,
Thanks for the reply.
I’m using yoast analytics and this was my best shot at getting a pageview sent for /doel/offerte/, unfortunately it’s not working yet.
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=\"__gaTracker('send', 'pageview', '/doel/offerte/');"; return $att; }
I’ve also tried this in analytics field but no luck
$('.avia_ajax_form .button').on('click', function() { __gaTracker('send', 'pageview', '/doel/offerte/'); });
March 30, 2016 at 7:07 am #604988Hi,
Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.
Thanks,
RikardMarch 30, 2016 at 4:53 pm #605283See below
March 31, 2016 at 7:21 pm #606137Hey!
You are using an old version of the theme, so please upgrade to Enfold 3.5.1 and let us know if you still need help afterwards.
Also upgrade your WordPress.
Cheers!
AndyApril 9, 2016 at 3:53 pm #610616Hi Andy,
Thanks for the reply.
I have updated the theme to the newest version but it’s still not working. I added the code below to force a virtual pagevisit to /doel/offerte but it’s still not working. Goal tracking is essential for a succeslfull website, so this would be a nice feature in new enfold versions:). In the meantime, i’d be great if you can help me get the right code.
`
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=\”__gaTracker(‘send’, ‘pageview’, ‘/doel/offerte/’);”;
return $att;
}
‘April 12, 2016 at 6:28 am #611668Hi!
This is a working goal tracker snippet: https://kriesi.at/support/topic/tracking-contact-form/#post-565219
For more info regarding goals creation, please refer to this link: https://support.google.com/analytics/answer/1032415#create_or_edit_goals
Regards,
IsmaelApril 16, 2016 at 3:58 pm #615484Hi Ismael,
Thanks for the reply, but I still didn’t get it working, i’m using yoast analytics plugin.
I added goal like this:
And this code to the bottom of functions.php
‘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([‘_offerte’, ‘offerte’, ‘offerte’, ‘offerte’, 1, true]);\””;
return $att;
}’Kind regards!
April 19, 2016 at 7:27 am #617155Hey!
It only counts actions per unique sessions (use another computer or network) and it may take a few hours before you receive any results. Where is the contact form located?
UPDATE: The code should be:
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', 'offerte', 'offerte', 'offerte', offerte, true]);\""; return $att; }
Cheers!
IsmaelApril 20, 2016 at 11:53 am #618211Hi Ismael,
It’s also possible to monitor the goals under the realtime section in analytics.
I added the code you sent to a portfolio item but still no luck. Please take into account that i’m using the yoast analytics plug-in to connect analytics to the site. If you want to, i can provide you with ftp of the live site + make you editor of the analytics for this site.
Kind regards.
April 23, 2016 at 3:55 pm #620555Hi!
I’m sorry but I’m not familiar with yoast analytics. The snippet we provided will only work for the default google analytics goals. Please contact the plugin author for more info.
Cheers!
IsmaelApril 24, 2016 at 1:48 pm #620801Hi Ismael,
Thanks for the reply again.
I switched to the default analytics (add code in theme options) but it’s still not working.
Kind regards.
April 24, 2016 at 7:21 pm #620850Hi!
There are several steps you need to follow to add google tracking code one of which includes verify your domain name. I hope you have performed these steps only then it will work for you.
please check this link and follow all the steps
https://support.google.com/analytics/answer/1008080?hl=en
https://support.google.com/analytics/answer/6280771
After all the necessary steps are performed you can add the tracking code in Enfold >Google Analytics Tracking Code
Regards,
VinayApril 26, 2016 at 7:59 pm #622490Hi Vinny,
Like i said earlier in this post, i know how analytics works and how to add a goal, also the tracking code is already added and working. I added the goal with settings like below, and Ismael provided me with a piece of code to go with it, unfortunately the code doesn’t work.
Kind regards.
April 29, 2016 at 12:22 pm #624317Hi,
Please post the login details for the google webmaster and the link to the contact page. We will try to set up a goal.
Best regards,
IsmaelMay 2, 2016 at 10:41 pm #626074Hi Ismael,
See below for the google account, please let me know if you need something else.
May 6, 2016 at 4:36 am #628062Hi,
There are 2 contact page there. Which one are you using? I can see that you changed the onclick attribute of the button. Is this working? Unfortunately, I can’t access the gmail account because it requires authentication or the recovery email address.
Confirm the recovery email you provided in your security settings: luc••••••••@gmail.com
Best regards,
IsmaelMay 11, 2016 at 6:59 pm #630903Hi Ismael,
You can use the goal offerte2 to setup the goal.
The goal ‘contactaanvraag’ is for the contact form on the contact page, this is working properly with contact form 7 using the code on_sent_ok: “ga(‘send’, ‘pageview’, ‘/doel/contact/’);”.
Recovery mail is below.
Kind regards.
May 13, 2016 at 7:54 am #631883Hi,
I was able to login to the webmaster dashboard but there is no registered site there. How did you manage to create a goal without verifying a site that you owned? https://support.google.com/webmasters/answer/35179?hl=en
Best regards,
IsmaelSeptember 6, 2016 at 3:37 pm #682674Hey,
I’ve tried to set up the same. This is the code I’ve added to the functions.php of the Child-Theme:
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', 'request', 'request', 'request', 1, true]);\""; return $att; }
The Goal is set up for the property as follows:
Category (equals): request Action (equals): request Label (equals): request Value (equals): 1
And this the Tracking Code added via the Google Services Analytics Tab in the Theme’s Options:
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker'); __gaTracker('create', 'UA-12345678-1', 'auto'); __gaTracker('set', 'forceSSL', true); __gaTracker('set', 'anonymizeIp', true); __gaTracker('require', 'displayfeatures'); __gaTracker('require', 'linkid', 'linkid.js'); __gaTracker('send','pageview'); </script>
1. Should it work this way? I am confused as for the value you posted “offerte” above also and not the value set as a goal. Furthermore, is “equals” alright for the value or should it be “greater than”? Or is the value not needed in this case and I should replace the “1” in the functions.php with “request” also?
2. Will this also deliver the keyword over which the user came to the website, if the target URL on the Ad provides this information?
Thanks a bunch,
eCSeptember 10, 2016 at 4:06 am #684389 -
AuthorPosts
- You must be logged in to reply to this topic.