mooyoul / angulartics-facebook-pixel

Facebook Pixel plugin for Angulartics
MIT License
20 stars 7 forks source link

Adding Pixel Specific Events/Actions #8

Closed robguy21 closed 8 years ago

robguy21 commented 8 years ago

How can I trigger the below code through this module?

Would usually run it like this with google-analytics

$analytics.eventTrack('Some Event', {category: 'pew pew', label: 'Rawr'});

Not sure how to get the same thing going here

mooyoul commented 8 years ago

Ah, sorry for inconvenience. There are event filtering exists (link)

I can`t be sure Facebook Pixel supports custom events like Google Analytics's events. There are no related articles on facebook help center. but it's interesting feature request.

Did you use custom events on Facebook Pixel? Does Facebook Pixel reports custom events correctly on dashboard?

robguy21 commented 8 years ago

@mooyoul man I was just about to come back and edit my issue to be more precise.

Accordingly to an email I received it definitely looks like they do support them... here is the list of standard events they have.

Realizing now that you specifically said custom events... the rest of this comment may be useless. I'm specifically talking about the following code you would have on normal websites.

<script>
    fbq('track', 'Lead');
</script>

Again, sorry for my first comment it's super vague and I see that I didn't include half the stuff I meant to..


Standard Events
Add standard events to your code to track specific types of actions on your website. Copy the code for the type of event you want to measure, and paste it below the pixel code on the relevant page within a <script> tag. Keep in mind standard event codes are case-sensitive. Learn more about conversion tracking.

// ViewContent
// Track key page views (ex: product page, landing page or article)
fbq('track', 'ViewContent');

// Search
// Track searches on your website (ex. product searches)
fbq('track', 'Search');

// AddToCart
// Track when items are added to a shopping cart (ex. click/landing page on Add to Cart button)
fbq('track', 'AddToCart');

// AddToWishlist
// Track when items are added to a wishlist (ex. click/landing page on Add to Wishlist button)
fbq('track', 'AddToWishlist');

// InitiateCheckout
// Track when people enter the checkout flow (ex. click/landing page on checkout button)
fbq('track', 'InitiateCheckout');

// AddPaymentInfo
// Track when payment information is added in the checkout flow (ex. click/landing page on billing info)
fbq('track', 'AddPaymentInfo');

// Purchase
// Track purchases or checkout flow completions (ex. landing on "Thank You" or confirmation page)
fbq('track', 'Purchase', {value: '1.00', currency: 'USD'});

// Lead
// Track when a user expresses interest in your offering (ex. form submission, sign up for trial, landing on pricing page)
fbq('track', 'Lead');

// CompleteRegistration
// Track when a registration form is completed (ex. complete subscription, sign up for a service)
fbq('track', 'CompleteRegistration');

// Other
// 
fbq('track', 'Other');
mooyoul commented 8 years ago

ah that's not problem. it's okay. anyway standard pixel events like Lead, Purchase, ViewContent, etc. are already supported on this module.

If you call $analytics.eventTrack('Lead') programmatically , angulartics emits that event to registered angulartics providers.

For example: if you are using angulartics with angulartics-google-analytics and angulartics-facebook-pixel, emitting events in angulartcis will emit events to both google analytics and facebook pixel.

If i misunderstood your question, let me know. Thanks!

robguy21 commented 8 years ago

Oooh okay cool. Thanks for clarifying that!

mooyoul commented 8 years ago

you're welcome! Don't forget give a star hahaha :+1:

mvaz73 commented 5 years ago

Hi @mooyoul , I am coding an Angular 8 (not AngularJS) app and I use a Router component to navigate on the SPA. I need to fire a standard PageView every time I change the path (meaning a path would change from http://www.mysite.com/#/path1 to http://www.mysite.com/#/path2. I want to capture the "/#/path2". Does angulartics-facebook-pixel support this kind of use? How can I use it on an Angular 8 app? Can you please provide instructions on how to integrate your module on an Angular 8 app?