josemarluedke / ember-cli-segment Goto Github PK
View Code? Open in Web Editor NEWEmber CLI Segment provides an easy way to integrate your Ember application with Segment
License: MIT License
Ember CLI Segment provides an easy way to integrate your Ember application with Segment
License: MIT License
import Ember from 'ember';
import segmentMixin from 'ember-cli-segment/mixin';
export default Ember.Component.extend(segmentMixin, {
init: function() {
self.trackEvent('Event name');
}
});
A practical result of this is not having the event console.log
.
Ember-CLI 0.2.5 introduced the following deprecated APIs:
DEPRECATION:
lookupFactory
was called on a Registry. Theinitializer
API no longer receives a container, and you should use aninstanceInitializer
to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details.DEPRECATION:
lookup
was called on a Registry. Theinitializer
API no longer receives a container, and you should use aninstanceInitializer
to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details.
The relevant source is in the initializer line 5 and line 13.
Seems that the '.git' folder has been included in the NPM package which results in 'ERR! git /opt/build/repo/node_modules/ember-cli-segment: Appears to be a git repo or submodule.' on npm install.
Only seems to affect 3.2.0 at this time.
When sane Content Security Policy directives are enabled, this addon doesn't work, as it includes the tracking snippet as an inline script.
The snippet should preferably be added to vendor.js
. What are your thoughts on this?
The latest tag (4.4.0) is not the latest release, with that ember-source@4
will fail in the segment service
On master the service was refactored, using the package with the latest commit hash works as expected.
Hi,
Since upgrading to Ember v3.26 we now have a deprecation warning about segment service being injected implicitly.
Here are some more info on the deprecation strategy they're using considering implicit injection :
https://emberjs.github.io/rfcs/0680-implicit-injection-deprecation.html.
The first step would be to explicitly import the Segment Service but as this is doing things silently under the hoods. I don't know where to start to help make it totally explicit.
Thank you
Updating a query param, for example, even via replaceState
causes a page view to be logged. This is problematic in cases where a user typing into a search field updates a query param to make the search bookmark-able, which should not be individually tracked.
Ember's query param behavior always causes a didTransition
event, so I'm not sure how to prevent this.
Can we already switch to 2.0 today? Without any change to this addon?
We’re excited to share with you that we’re rounding out our upgrade to Analytics.js 2.0 by planning to end service of the Classic version over the next 13 months. Not to worry — you’ve got plenty of time to determine your migration plan. Check out our Analytics.js documentation to learn more.
Here are some key dates to keep in mind:
- August 31, 2022 - End of Support: at this time we’ll stop maintaining, upgrading, or updating Analytics.js Classic.
- February 28, 2023 - End of Life: at this time, we’ll be removing access to Analytics.js Classic.
For example controllers
and router
.
Looking at the code, I looks like you do no support anything after Ember 1.10
. Is it intended? Any plan on supporting more recent versions?
With local development and ENV.segment.enabled = false;
, I'm seeing a warning message in console https://github.com/josemarluedke/ember-cli-segment/blob/master/addon/services/segment.js#L22
Should we not throw the warning error if segment.enabled = false?
Right now, you have to use functions of segmentMixin
directly in the component object. Would be nice to use them through segment
object, as in routes, for instance.
import Ember from 'ember';
import segmentMixin from 'ember-cli-segment/mixin';
export default Ember.Component.extend(segmentMixin, {
init: function() {
this.trackEvent('Event name');
}
});
It seems that segment isn't loaded in the init
or activate
hooks in the application route. When I try to call Bugsnag
from this point in the application, it says it's not defined.
I also need to use the integration in the build process of the app, and report errors to Bugsnag.
Would you be able to provide some guidance on how to ensure it gets loaded immediately, or for me to be able to manually ensure it's available?
Thanks,
Anthony
I want to disable any local tracking and only allow Segment to function on production builds. I mainly use the idendifyUser
and trackEvent
methods.
I've extended the service in my app and overridden those methods to check the current environment name. Is there a better way?
Let's try to remove the need to use container.lookup
in the initialize. If we still need it, use the new getOwner
API.
We'd like to pull our key from our server so that our app can be statically hosted and provide configuration based on the domain where the site is hosted.
By the time we are able to pull the configuration from our api the segment module is already loaded.
Is there a way to delay this?
Hi, I have a question regarding calling identifyUser
on every route didTransition
action.
Is this something necessary? or is a workaround to any known issue or something? I'm asking because here they say The identify call specifies a customer identity that you can reference across the customer’s whole lifetime.
, so, I don't see the need to call it every time.
Thanks.
I was wondering if it would be possible to skip or delay sending events to Segment for unidentified users, and whether a PR would be accepted that enables that.
We had an issue where sending trackEvents to Segment without having properly identified our users was leading to cost overrun. We already had some code in our identifyUser block that skipped the call if we didn't have a valid user id yet, but also had to add some code to our function that calls trackEvent in order to make sure that if a user was not identified the event isn't sent. However there were also other calls that we weren't making directly, like ember-cli-segment's built-in page tracking, that we didn't have a way of blocking for anons (though we ended up turning off that feature with config).
Obviously skipping these tracking calls for unidentified users is less-than-ideal, if the user will be identified but it hasn't happened yet; it would maybe be better to defer tracking until after identify is successful. Perhaps a solution would be some sort of promise chain, starting with whatever should trigger a successful identify and then the tracking calls chained after that.
So I guess my question is, any thoughts, am I missing something obvious that's already here, and would this be better as a PR or a fork?
Is there a way to configure segment events to go through a different endpoint on our backend? Blockers like uBlock origin will prevent this library from sending segment events.
In my .ember-cli
file I set "disableAnalytics": true
but still it is doing all the calls to segment.
Did I miss something, or did something wrong. Or is it a bug?
Thanks
It should probably be installing the stable version instead.
I am getting this error when using this addon.
I see this in chrome developer tools when I am trying to visit the page.
According to the readme, "The add-on exposes a service that you can inject in ...". I am injecting this in my controller and the above error is thrown when visiting that page and the page is not loading. Did I miss any step or my ember version is the problem? I am using ember 1.12.
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.