-
Notifications
You must be signed in to change notification settings - Fork 249
Boilerplate: add Disqus and Google Analytics #428
Comments
The components part is easy. But how to add/remove them according to user's answer ? Also how to add them when user run |
Meanwhile for GA:
|
There is a tutorial https://theduke.at/blog/develop/how-to-use-google-analytics-with-phenomic/ |
This is tricky. I think we should provide an easy way for folks to do this, but GA can be implemented via this component OR via something like segment.io Perhaps giving users a way to inject custom html/js into the footer of the page would solve this. Probably one of the hardest things to do with a dynamic site like this is adding custom scripts to given pages b/c you have to learn and use Netlify has a pretty nifty feature that lets you inject any custom stuff you want into your site after it's build process is done: Just thinking it might be cool to start potentially thinking about this for phenomic as perhaps some ORRRR even better, giving the user access to the Sorry for rant =) |
I really don't want to allow an index.html template: this does not make sense. When you are on the client side, the code won't be executed on each pages, just once! Helmet is pretty easy to "learn" and I think we can add example in the docs. |
@thangngoc89 I saw you use autotrack for your |
See #384 ;) |
Thank you |
@MoOx and @xuopled should the autotrack set-up in @MoOx/react-toulouse@c42045d still the best way to set-up GA? Not sure if it matters but autotrack got bumped up to v2. I prefer to have auto-tracking, but I ended up having to set-up react-ga for the time being. |
I finally used |
I just checked my current setup for react-toulouse website and it's working like a charm (checked using real-time tracking). I didn't update tho. |
Interesting. @MoOx do you no longer need react-ga with the auto track setup? MoOx/react-toulouse@c42045d |
I followed the steps in MoOx/react-toulouse@c42045d several times. I get this error though |
@kchens this looks like a webpack configuration issue (saying this because of |
@kchens The reason of this error is that imported files (for example node_modules/autotrack/lib/plugins/url-change-tracker.js) are not processed by babel. According to webpack config only scripts and src folders are processed. Only node_modules/autotrack/autotrack.js is ready for importing. |
@yatsyk do you have any solutions for this? Cause I am experiencing the exact same problem. |
@codepreneur you can use autotrack by importing autotrack.js with all plugins enabled or use features you need by importing particular files from lib/plugins folder. I think that importing 'autotrack' with all plugins should work without additional settings. |
@MoOx I'm encountering the same error as @codepreneur and @kchens I'm on webpack v1.11.0 and I'm using Phenomic's default webpack config. I'm running on phenomic v0.20.3 |
@jedau @codepreneur @kchens I'm also on webpack v1.11.0. I have same error when set-up GA. Did you guys still have this error ? Any workaround available ? Thank you @MoOx |
Might add a thing in an example but not a priority for v1. |
setup should ask user for their id, and if present, boilerplate should contains required components.
The text was updated successfully, but these errors were encountered: