We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2525cd3 commit 87aa949Copy full SHA for 87aa949
projects/pixel/src/lib/pixel.service.ts
@@ -33,9 +33,13 @@ export class PixelService {
33
* - Adds the script to page's head
34
* - Tracks first page view
35
*/
36
- initialize(): void {
+ initialize(pixelId = this.config.pixelId): void {
37
+ if (this.isLoaded()) {
38
+ console.warn('Tried to initialize a Pixel instance while another is already active. Please call `remove()` before initializing a new instance.');
39
+ return;
40
+ }
41
this.config.enabled = true;
- this.addPixelScript(this.config.pixelId);
42
+ this.addPixelScript(pixelId);
43
}
44
45
/** Remove the Pixel tracking script */
0 commit comments