Git Product home page Git Product logo

km-wordpress's Introduction

** 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)

km-wordpress's People

Contributors

bjsummerfield avatar eskfung avatar nathanielwroblewski avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

km-wordpress's Issues

Problem with Link tracking and Lightboxes

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!

Link tracking in pages/posts

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.

Debug errors

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.