homepage: incendium.ai
import: import { Angulartics2Incendium } from 'angulartics2';
-
Add tracking code provided by Incendium inside the header tag.
-
Setup Angulartics using
Angulartics2Incendium
constructor(Angulartics2Incendium: Angulartics2Incendium) { Angulartics2Incendium.startTracking(); }
-
Track Conversions, You can track conversions using Angulartics2 event tracking. this can be done by adding the following to you html
<button angulartics2On="click" angularticsAction="{{ eIncendiumEventNames.ADD_CONVERION }}" [angularticsProperties]="{ key: 'my_trigger_as_assigned_in_incendium' }" > Btn click </button>
Note that eIncendiumEventNames is a reference to IncendiumEventNames expoted from Angulartics2Incendium
Or you can fire the conversion in code for example
this.angulartics2.eventTrack.next({ action: IncendiumEventNames.ADD_CONVERION, properties: { key: 'my_trigger_as_assigned_in_incendium', }, });
-
Incendium allows for offline tracking, to do this you must record the conversion key provided when firing a conversion. A example of this would be a contact form which you later convert on the phone, incendium allows you to assign revenue next to this original conversion using this key
to do this fire a conversion off as above. you can then subscribe to incendiumResponse. once the conversion has been tracked and response is returned you can use this response how ever you like.
Dont forget to unsubscribe
An Example workflow of this would be
export class Example implements OnInit { private incSubscription; constructor( private angulartics2: Angulartics2, private angulartics2Incendium: Angulartics2Incendium, ) {} ngOnInit(): void { this.incSubscription = this.angulartics2Incendium.incendiumResponse.subscribe({ next: v => { if (v.type === IncendiumEventNames.ADD_CONVERION) { this.submit(v.value); } }, error: e => { console.error(e); // submit without key or handle how you like this.submit(); }, }); } ngOnDestroy(): void { // Dont forget to unsubscribe this.incSubscription.unsubscribe(); } onSubmit() { this.angulartics2.eventTrack.next({ action: IncendiumEventNames.ADD_CONVERION, properties: { key: 'my_trigger_as_assigned_in_incendium', }, }); } submit(incendiumKey?: string) { alert(`form submitted with ${incendiumKey ? `key ${incendiumKey}` : `no key`}`); } }