Forum Replies Created
-
AuthorPosts
-
March 2, 2015 at 11:45 am in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68614Ralph12Member
I finally had the time to implement your filter update and I can confirm that it works like a charm! Real-time Analytics testing showed that only (and all) validated sign ups are tracked correctly now.
Thank you very much for your time and effort
February 24, 2015 at 12:49 pm in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68612Ralph12MemberOkay, I’ve tested the check and it does indeed prevent the tracking of invalid forms. However, it seems it works a bit too good… valid forms, that never had any errors, are always being tracked correctly. But valid forms that have fixed validation errors, are only being tracked after ‘unfocusing’ (by clicking somewhere else on the page) the fixed form fields. Seems the ‘unfocus’ click is required in order to properly reset the validation status of the form. Whatever the cause; unfortunately the check is not 100% reliable (never tracks invalid signups, but it might miss some valid signups as well).
All in all I believe your filter approach is the way to go. Please let me know if I can help with the testing.
February 21, 2015 at 2:35 am in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68610Ralph12MemberNot sure whether you’ve already added the filter, but it seems I did find something that might work… it has only been tested with an ‘alert’. Apparently the Validation Plugin can work with checks like this:
if ($('#regForm').valid()) {
The complete tracking code with the check implemented (should only track valid form submissions):
<?php
function add_goal_conversion_tracking() {
if (is_page('PAGE_ID_AFF_SIGNUP_FORM')) {
?>
<script>
(function($) {
$(window).load(function() {
$('#regForm button[type="submit"]').on('click', function() {
if ($('#regForm').valid()) {
ga('send', 'event', 'Affiliate Signup Form', 'signup', 'form', 1);
}
});
});
})(jQuery);
</script>
<?php
}
}
add_action('wp_footer', 'add_goal_conversion_tracking');
?>Could you please let me know what you think of this approach / the above code?
February 20, 2015 at 10:32 am in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68609Ralph12MemberThanks, sounds good to me!
February 19, 2015 at 3:42 pm in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68607Ralph12MemberOk, thank you for clearing things up! It would be great if a future version of Affiliate Platform had a similar feature as Contact Form 7: http://www.astralwebinc.com/contact-form-7-wp-how-to-add-event-tracking-on-new-universal-google-analytics/ The described CF7 feature only triggers the tracking code, when a form submission is valid.
February 19, 2015 at 1:12 pm in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68605Ralph12MemberThe tracking code described in this topic is triggered each time the signup button is clicked. Because of this GA still registers a conversion, even when the form is invalid. The ideal situation would be to only register a conversion when the form submission is valid.
Do you perhaps know how to trigger the tracking code, only when the signup form submission is valid? Maybe a check which checks whether the validation script outputs errors? Or does this require modding WP Affiliate Platform’s core code?
February 18, 2015 at 6:36 pm in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68604Ralph12MemberThanks for shedding your light on it! Initially I just assumed that the code would work, but because of your post I figured I better do some proper testing. And I quickly found out that GA was not tracking anything. Here’s why:
I use the ‘Google Analytics by Yoast’ plugin to insert the GA Universal code and it defines ‘__gaTracker’ instead of the standard ‘ga’. So, after replacing:
ga('send', 'event', 'Affiliate Signup Form', 'signup', 'form', 1);
With:
__gaTracker('send', 'event', 'Affiliate Signup Form', 'signup', 'form', 1);
GA started tracking the signup button clicks as events/conversions.
Also, a great way to test any event/goal tracking code, is via GA’s real-time reporting feature. Here’s how to do this:
Login to GA > Reporting tab > Real-Time > Events and Conversions. Make sure to not filter your own traffic and you’ll be able to see real-time, whether button clicks and form submissions are being tracked. For reference: https://support.google.com/analytics/answer/1008083?hl=en
Hope the above helps someone
Thanks again guys,
Ralph
Ralph12MemberThank you for clearing things up and for the tip re the settings menu!
February 17, 2015 at 11:47 am in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68602Ralph12MemberI’m thinking of adding the following code to functions.php:
<?php
function add_goal_conversion_tracking() {
if (is_page('PAGE_ID_AFF_SIGNUP_FORM')) {
?>
<script>
(function($) {
$(window).load(function() {
$('#regForm button[type="submit"]').on('click', function() {
ga('send', 'event', 'Affiliate Signup Form', 'signup', 'form', 1);
});
});
})(jQuery);
</script>
<?php
}
}
add_action('wp_footer', 'add_goal_conversion_tracking');
?>What do you think of the above code?
February 16, 2015 at 5:03 pm in reply to: WP Affiliate – Track sign ups with Google Analytics Goals? #68601Ralph12MemberI’d like to set up a GA goal for sign ups, as this will allow me to easily track stats like the visitors vs. sign ups ratio. Such stats would help me to track the effectiveness of marketing efforts promoting my affiliate program.
Here are my 2 cents:
Maybe signups can be tracked as an event via a GA goal, just like contact form 7 does: http://www.astralwebinc.com/contact-form-7-wp-how-to-add-event-tracking-on-new-universal-google-analytics/
A checkbox could then be added to Affiliate Platform’s admin area, (de)activating the event code line after a sign up. The event values (Category, Action, Label, Value) that GA needs, could be written near the checkbox. So users can simply copy/paste these values to the GA event goal’s settings.
Here’s more info re the above idea: https://developers.google.com/analytics/devguides/collection/analyticsjs/events
Not sure whether this will work though.
February 11, 2015 at 1:25 pm in reply to: WP Affiliate – Record Verified Affiliate Clicks Only? #68517Ralph12MemberAh, ok. Thank you for the explanation!
November 4, 2014 at 1:08 pm in reply to: Protected Content – Redirect to login page automatically (instead of message) #65756Ralph12MemberI can confirm that the addon is working correctly… it redirects to the login page when a protected page is visited.
October 29, 2014 at 9:19 am in reply to: Showing the Member Registration Completion URL on the Thank You Page #47485Ralph12MemberThanks for the explanation and suggestions, admin! I’ve decided to have the TY page explain to people, that they should check their email for additional steps that have to be completed. Simply because that seems to be the easiest and most fail-safe approach.
Though I would like to add a suggestion:
Modding the code below:
if($member_rego_data_needed && WP_ESTORE_SHOW_REGO_COMPLETION_LINK_ON_TY_PAGE==='1'){
… located in the eStore_includes3.php file, is an option. One could use this to either output TY text with unique URL (buttons), if $result is not 0 else display TY text without buttons / unique URL.
I didn’t go for this option, because one has to hard code the TY page content. Making it impossible to easily edit the page’s content via the WP admin dashboard.
But while I’m at it, I’d like to share the following idea with you (solving the need to hard code 2 TY page content versions, as mentioned above):
How about adding a section like “Affiliate Area/Center Related Options” to eStore’s Settings area? Then, if WP_ESTORE_SHOW_REGO_COMPLETION_LINK_ON_TY_PAGE is set to 1 (via the same dashboard section), people can add 2 different HTML-supported versions of TY page content; 1 for when the URL is created / with buttons/link, 1 for when the URL is not yet created / without buttons/link.
The unique reg URL could be a {unique_reg_url}-like tag, which can be placed anywhere in the TY page content. Making it also possible to use it as a button URL. People who’d rather prefer a simple clickable link, could use a {unique_reg_link}-like tag.
Then a content adding shortcode should be added to the actual TY page, just like most of the eMember-related pages.
The TY content version without the reg URL, is always required (ensuring the TY page is never completely blank, should people use the shortcode). And the version with the reg URL is optional (only required once WP_ESTORE_SHOW_REGO_COMPLETION_LINK_ON_TY_PAGE is set to 1).
Though perhaps you are already thinking of a better approach.
October 28, 2014 at 8:03 am in reply to: Showing the Member Registration Completion URL on the Thank You Page #47483Ralph12MemberThank you, wzp! I was wondering whether the unique register URL, can also be retrieved via a shortcode?
This is my plan / why I’m asking the above question: My theme’s builder dashboard can add buttons, to pages/posts, with a few clicks. One can easily give such buttons a URL via the theme’s dashboard. I’m looking for a way to add the unique reg URLs, to a theme button’s URL/link setting. So the 2 buttons, I placed on the TY page, automatically have user specific reg URLs as their href values. And I believe a shortcode should do the trick.
October 27, 2014 at 5:28 pm in reply to: Showing the Member Registration Completion URL on the Thank You Page #47481Ralph12MemberWhen this option is enabled, does the customer still receive the email (containing the link) as well?
Looking at the code, I’d say yes. But I prefer to have it confirmed. Thank you!
-
AuthorPosts