npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

can't track my e-commerce transaction with angular 7

My index.html head

(i[r].q=i[r].q||).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga(‘create’, gaCode , ‘auto’);

app.component.ts constructor => {
if (event instanceof NavigationEnd) {
ga(‘set’, ‘page’, event.urlAfterRedirects);
ga(‘send’, ‘pageview’);

      ga('require', 'ecommerce', 'ecommerce.js');
      // Transaction Data
      ga('ecommerce:addTransaction', {
        id: '1234',
        affiliation: 'Example Page',
        revenue: '100',
        shipping: '0',
        tax: '0',
        currency: 'USD'

(You might get an answer here, but because this forum is focused on npm, you might want to ask your question somewhere that targets experts with your package. I have moved your topic to #community:javascript)