Coder Social home page Coder Social logo

angular-ga's People

Contributors

samverschueren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angular-ga's Issues

ERROR Error: Could not load GA

It is not working with measurement id provided by google analytics.

I am trying to implement event tracking using this Extension. However it is giving me error ERROR Error: Could not load GA.

I analysed 1 thing that it is not working with measurement id (i.e., 'G-XXXXXXX') provided in new Analytics account . However event tracking is working when i use tracking id(i.e., 'UA-XXXXX') of any old project. So, will this extension not work for new projects. Or is there any workaround.

Demo page??

Hi -- Is there a demo page somewhere to demonstrate how to use this lib in Angular? I'd like to see how to make the various GA tracking calls through your lib.

Thanks!

Anonymize IP

Heey we are currently using angular-ga and all has been working great.
However we now need to add anonymization to it aswell and there doesn't seem to be a configuration for this?

Normally one would do

gtag('config', '<GA_MEASUREMENT_ID>', { 'anonymize_ip': true });

which makes this work however for us it doesn't seem to work..
In our appModule we have the following:

    private gtag(...args: any[]) {
        const win = window as { [key: string]: any };
        const dataLayer = win['dataLayer'] = win['dataLayer' as any] || [];
        dataLayer.push(args);
    }

    private initializeGoogleAnalytics() {
        this.gtag('js', new Date());
        this.gtag('config', environment.gaToken, { 'anonymize_ip': true });
    }

We call this for every router event

Help is much appreciated!

EDIT: Official docs -> https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization

Request for 2 additional params to the configure method in your code?

Can you add the other optional params for the configure method in your code? This would be much appreciated!

Google allows several more params to the create call which include "name" and "userId". You currently only provide 2 params - trackingId and cookieDomain. It seems like all you have to do is modify these 2 lines of code in your angular-ga.js file:

configure(trackingId, options = 'auto') {
ga('create', trackingId, options);

This is from the Google Analytics site - https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_with_multiple_trackers

ga('create', {
trackingId: 'UA-XXXXX-Y',
cookieDomain: 'auto',
name: 'myTracker',
userId: '12345'
})
;

Calling configure sends a pageview

Hi,

I would like an option to prevent the configure method on the gaService from sending a pageview. I have some re-write rules within the application that I run before sending a pageview to GA which are not taken into account when using this library.

Create UMD bundle

I should also ship the module with an UMD bundle to make sure everyone can easily use the module.

Doesn't work with AoT

It doesn't seem to work with AoT, not sure why though. I'm using angular-cli and while ng serve runs perfectly, ng build --prod --aot fails with the following error.

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function

I have no clue whatsoever.

@ocombe Any ideas? I'm really in the dark with this one and have no clue about what could cause this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.