Hi,
I'm developing a JavaScript API which would work in a similar way as e.g. Google Analytics (GA) tracking code. Because they already thought of a nice structure, I would hate having to re-invent variable and methods names for the client.
Where GA would use:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxx-x']);
_gaq.push(['_trackPageview']);
I would do something like:
var _myapp = _myapp || [];
_myapp.push(['_setAccountId', '12345']);
_myapp.push(['_trackPageview']);
I'm guessing push
shouldn't be a problem since it's a native javascript method. But should I consider using different variable names? Besides using _setAccountId
and _trackPageview
, I would use a number of other variable names (_trackEvent
, _setDomainName
, and so on)
This will only be needed for the client code for the users, the actual javascript file handling the requests will be build without reusing anything from Google.
Should I be concerned?