Comments (5)
Is this primarily to add abstraction to waiting for when the KM object is ready?
_kmq.push(function() {
$.event.trigger("kmLoaded");
// This function executes *because* KM has loaded
// why not doStuff here?
});
from km-support.
In my particular use case, the abstraction provides better interoperability with my tag management platform's script firing conditions and (I think?) some timing / performance benefits as well.
BrightTag, the tag manager we are using, manages all events and data in one place to determine the conditions when any particular code block will execute without placing the entire burden on client-side JS. For my use it's convenient and efficient to have an event to bind to because there's a place for event firing conditions in their interface and their system deals with code optimization for me.
In general and for users with a more traditional setup, I would imagine pushing heavy functions to _kmq being something that slow things down a bit... but I'm by no means an expert in these things. Just figured others could find this useful if they either use a 3rd party tag manager, or if they would like timing to be managed outside of KM.
On Jul 18, 2013, at 5:13 PM, Eric Fung [email protected] wrote:
Is this primarily to add abstraction to waiting for when the KM object is ready?
_kmq.push(function() {
$.event.trigger("kmLoaded");
// This function executes because KM has loaded
// why not doStuff here?
});—
Reply to this email directly or view it on GitHub.
from km-support.
Ah, good point. If tag managers get involved, I can see how this would be useful.
I can incorporate your explanation into an alternate version of http://support.kissmetrics.com/apis/javascript/javascript-specific/#callback-functions
from km-support.
from km-support.
Just wanna say that I was halfway through typing my request to support when I ran into the part in the kissmetrics docs where it said this trick. It's exactly what I needed and for similar reasons, so thanks both @eskfung and @jonazri!
from km-support.
Related Issues (20)
- 2 Quick issues HOT 3
- Broken URL HOT 5
- Revenue tab is gone. The Revenue report is under the Reports tab now. HOT 1
- Offset and limit parameter not work HOT 4
- PHP documentation outdated HOT 5
- Querying metrics HOT 3
- People Report has no results HOT 2
- Add libraries
- Common Methods - Missing the alias method HOT 1
- people_v3_search custom date ranges not working HOT 6
- Link tracking in pages/posts HOT 7
- De-duplication: clobber or merge? HOT 6
- Consider ways to minify asset pipeline. HOT 4
- Screenshots need updating
- Clean up sidenav
- Broken Link on Qualaroo Page HOT 1
- You can include up to 10 property columns? HOT 1
- No link to download the JavaScript library HOT 5
- Revenue report has broken links HOT 1
- How much data will the iOS SDK store while offline? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from km-support.