Event Tracking for badge achievements in Wordpress?

I’m trying to figure out how to track when someone completes an achievement/badge on my wordpress site using the BadgeOs plugin.

My questions.

  1. Where does the event tracking code go on the page? In the header? In the body?

  2. I don’t know what to put for the YOUR_EVENT or ANY_DATA values in the event tracking script.
    I asked about it on the support page of BadgeOS and they said:

I think your best bet is going to be the following action hook in BadgeOS:

do_action( ‘badgeos_award_achievement’, $user_id, $achievement_id, $this_trigger, $site_id, $args );
It fires whenever an achievement gets awarded, and you’ll have access to the user ID who got awarded, the achievement ID, which is going to be a post ID, since achievements are post type posts, as well as the trigger, site ID, and some other arguments.

With that, you should be able to work out something to do with the Active Campaign logging or emailing

But I’m not sure which of those variables to put in. Any ideas? Any help would be greatly appreciated.

Is this something I could figure out myself or will I need to hire someone?

1 Like

I’m guessing that the value for YOUR_EVENT in the code should match one of the “added events” from the Event Tracking page in AC. Does this need to match anything on the page other than the event tracking code, or is it simply something used by AC to distinguish the event?

Thanks!

Hey @roughwriters!

Insert your event tracking snippet into the body of the page.

You can have BadgeOs populate AC with your user’s achievements by having it push event date that’s defined by you to our platform’s event tracking. You could use $achievement_id or any other naming convention you want. It will automatically populate as a segment in the site events section.

In regards to the ability to figure this out yourself, it depends on if you’re comfortable implementing our event tracking feature or not.

1 Like