Angular Failed to Compile
theelement115 opened this issue · comments
I am integrating google analytics with an angular project but i am unable to import the @analytics/google-analytics package.
But when I run ng serve i get this error.
Error: export 'googleAnalytics' (imported as 'googleAnalytics') was not found in '@analytics/google-analytics' (possible exports: default, init)
✖ Failed to compile.
this is my code:
import {Analytics} from 'analytics'
import {googleAnalytics} from '@analytics/google-analytics'
export class ProductViewComponent {
...
analytics = Analytics({
app: 'Zaito web',
plugins: [
googleAnalytics({
measurementIds: ['G-*********']
})
]
})
Change import to
import googleAnalytics from '@analytics/google-analytics'