How would we go about adding Meta Pixel code for all events created by a center group can track Facebook ad campaigns? If implemented within the config file, please provide step-by-step instructions. If not, please explain how to go about this.
Hi Jermel,
Sure thing, you can add any tracking code you want to your LWC theme. Probably the way you’d want to do this is using a little bit of XPHP logic. Inside of your theme includes (probably a file path like _ingredients/themes/global/includes/footer.html) you could do something like
<xphp content="true">
<if var="group_directory" equals="/center-for-research/" />
<content>
<!-- LW: Paste your tracking code here -->
</content>
</xphp>
Then any calendar views or event views under /center-for-research/ (swap in your preferred URL) would load your tracking code as part of the theme HTML. Hope this helps! If you’d like more hands-on help with editing your theme files, feel free to reach out via the Request Help Form.
Thank you, Karl.
Just to confirm, if we’re trying to track all events created by a specific group (i.e. EJ Thomas Hall), for… <if var=“group_directory” equals=“/center-for-research/” />
Should read:
<if var=“group_directory” equals=“/ej/" /> OR <if var=“group_directory” equals=“/ej/events/” />
Events in question are linked from this landing page, Calendar | The University of Akron
Please advise.
Hi Jermel,
Yes, I believe that’s right, if you used <if var="group_directory" equals="/ej/" /> in your theme include with your tracking code inside, that should appear on all /ej/event/1234-my-event pages. You could also try <if var="group_fullname" equals="EJ Thomas Hall" /> if that were easier.
We recommend always giving this kind of a change a try on your dev site and confirm that it’s loading as expected before copying it to production. Or if you’d like our team’s hands-on help editing any theme files, you can get in touch via the Request Help Form.
Karl