kissmetrics / km-wordpress Goto Github PK
View Code? Open in Web Editor NEWKISSmetrics plugin for WordPress
KISSmetrics plugin for WordPress
** This repository is now deprecated, please see https://github.com/kissmetrics/KISSmetrics/releases/tag/v1.0.0 for the final versions of all included clients ** KISSmetrics is different from other analytics platforms due to a combination of three key features. We focus on funnels and conversions and make them easy to track and interpret, use people as the basic unit of measure, and support tracking of highly-flexible custom data through our simple API. Find out more at http://www.kissmetrics.com * ruby client has moved to https://github.com/kissmetrics/km * php client has moved to https://github.com/kissmetrics/kissmetrics-php * python client has moved to https://github.com/kissmetrics/py-KISSmetrics * perl client is complete with crontab option (untested)
When using Lightboxes with the KISSmetrics -> General tracking -> Links in posts/pages setting active I'm experiencing the following issue:
The Lightbox opens for a second then it redirects me to the URL of the actual Image.
This is caused by the "trackClickOnOutboundLink" event handler which is attached to all links within the post/page when the setting is active.
KM.trackClickOnOutboundLink = function (a, b, c) {
KM.e$(a, function (a) {
KM.ev(a, "click", function (a) {
try {
KM.record(b, c)
} catch (d) {}
for (var f = KM.sre(a); f && (!f.href || "a" != f.nodeName.toLowerCase());) f = f.parentNode;
f && (!f.target && !a.shiftKey && !a.altKey && !a.ctrlKey && !a.metaKey) && (KM.pdft(a), setTimeout(function () {
document.location = f.href // <---- redirection to the actual image
}, 250))
})
})
};
This event handler logs the click and redirects to the actual image location.
This bypasses the event handler of the lightbox which uses e.preventDefault() to prevent the click on the image to redirect to the actual image location.
The wordpress plugin should not attach this event to lightbox'd links.
I spend several hours on finding a way for bypassing this problem but the fact that the script uses setTimeout(..., 1) to add non-blocking script tags made it nearly impossible to find a reliable workaround.
While I've never developed with Wordpress (I'm coming from Drupal/node.js) I can guess that this problem might be quite hard to solve even when modifying the plugin.
I wanted to leave a report with my experience here anyway.
For now we ended up disabling the Setting in the kissmetrics module options.
Thanks!
Copying from kissmetrics/km-support#18
In function the_content( $text ) there is a condition to track the links.
// Track all links
if( get_option( 'kissmetrics_track_links' ) )
$text = preg_replace_callback( KM_Filter::$link_regex, array( 'KM_Filter', 'parse_content_link' ), $text );
... this renders:
<a href="#">hypertext</a>
... as ...
<a href="#">hypertext</a><script> /*kissmetrics*/ </script>
... and because that change in the HTML it's preventing another jQuery plugin from working. My suggestion is, that instead of modifying the HTML take the links that are found in the content, and put the kissmetrics push methods in one one script container at the end of the content.
This source code says version 0.0.1, but if you use the download link at kissmetrics.com (https://s3.amazonaws.com/kissmetrics-support-files/assets/integrations/wordpress/kissmetrics.zip) then it shows version 0.0.2.
Why is that?
Hey there!
The link to the Kissmetrics website is leading to the wrong place. The reference should be updated to https://www.kissmetricshq.com
Hi, other user types like author, contributor and others have access to the settings of the app, that shouldn't happen, only the admin should have access to the settings
Hello,
The plugin seems to be working fine though is launching 3 errors when I set WP_DEBUG
mode to true
in my WordPress wp-config.php
file:
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method KM_Filter::output_analytics() should not be called statically in /Users/username/Sites/wordpress/wp-includes/plugin.php on line 525
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method KM_Filter::identify_comment_user() should not be called statically in /Users/username/Sites/wordpress/wp-includes/plugin.php on line 525
Notice: Undefined index: comment_author_email_1d9d9ced2f96c1d209ee1d8157fc50af in /Users/username/Sites/wordpress/wp-content/plugins/kissmetrics/kissmetrics.php on line 346
I'm using...
Is this something that can be easily fixed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.