NielsCodes / ngx-pixel

An Angular library to simplify event tracking using a Facebook Pixel.
https://www.npmjs.com/package/ngx-pixel
13 stars 15 forks source link

Compatibility with Angular 16 and Angular Ivy #15

Open mspnr opened 1 year ago

mspnr commented 1 year ago

After upgrade from Angular 14 to 16 I've got the message:

'PixelModule' does not appear to be an NgModule class.(-996002) pixel.module.d.ts(5, 8): This likely means that the library (ngx-pixel) which declares PixelModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

I am using the latest version of the library from npm:

"ngx-pixel": "^1.1.1",

NielsCodes commented 1 year ago

Hey, it should support Ivy, but I haven't tested with Angular 16 yet. I'll do some testing and get back to this in the coming days.

duxor commented 1 year ago

I also have the same issue. Let's make a solution during the next week :smile:

rysal32 commented 1 year ago

Any solution so far?

sitthinan commented 1 year ago

I have the same problem bro, @NielsCodes do you have any updates?

onclave commented 10 months ago

Hello @NielsCodes , first of all, thank you so much for this awesome library. However, it would be great if you could provide an update for this issue, since I am stuck at upgrading with Angular 17 for this library. Could you kindly look into this? I think all you have to do is recompile the project with Angular 17. Would you be interested in a PR to resolve this issue?

onclave commented 10 months ago

@NielsCodes I have raised a PR ( https://github.com/NielsCodes/ngx-pixel/pull/18 ) to update the library to Angular v17. Kindly merge the PR and make a new release, if possible. Thanks in advance!

onclave commented 9 months ago

@NielsCodes since I did not receive any communication from you, I have gone ahead and released this same code under a different library name that supports Angular v17+ here - @bloomscorp/ngx-pixel since your library is under MIT license. I hope this helps others as well.

Also, on a different note, I hope you are doing good since I did not receive any communication from your end. I hope everything is alright on your end. And thank you, once again, for this library.

morsagmon commented 6 months ago

@onclave Thank you for this adjustment! An important modification would be to add support for the eventID param Facebook is encouraging to pass, in order to fortify deduplication of events reported through both the Pixel and ConversionAPI. This is how you're calling fbq now: fbq('track', eventName, properties);

The eventID is a possible fourth argument : fbq('track', eventName, properties, {eventID: 'EVENT_ID'});

Please see here: https://developers.facebook.com/docs/marketing-api/conversions-api/deduplicate-pixel-and-server-events

I believe as more will be leveraging the strong ConversionAPI alongside the Pixel, this will be very much needed.

Thanks! Mor

morsagmon commented 6 months ago

@onclave I went ahead and forked out from your repo. I adjusted the package to support the eventID param to Facebook. I also updated the readme to reflect your changes and my changes. Here: https://www.npmjs.com/package/ngx-pixel-eventid