I’ve used custom code to add pixels for Snapchat and Tiktok. As far as I can see this works, but I can’t seem to get events to work (not really even sure how to approach this part of things). These seem like relatively popular platforms to consider supporting for an easier setup all around?
Hello @Sam and welcome to our community!
Can you provide a website URL and instance name? I can take a look and maybe advise something with setup.
Thanks for the welcome
Website URL is https://www.kulturstudier.no . Instance name is https://kulturstudier.piwik.pro (assuming that’s what you meant with that?). The actual pixel (Snapchat fex) seems to be firing ok, it’s just the set up of the events that adds another layer of complication I haven’t had to deal with on the others I’ve done (Google Ads, Meta etc).
@Sam as far as I’m aware Snapchat has very specific system to setup tracking events and it relies on actions done via clicking specific URL. I couldn’t find any articles on creating custom event codes so I’m assuming this is what you are referring to.
Tiktok pixel on the other hand has support for custom events but they will need to be set as Custom HTML with script including correct code snippet.
Yes, I think the Tiktok one seems to be working as intended. I’ve added the standard Snapchat code (example below) using custom html and the general tag is working (page views are being tracked after a few hours delay at first and pixel shows as active).
<!-- Snap Pixel Code -->
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'https://sc-static.net/scevent.min.js');
snaptr('init', 'xxxx-yyyy-0000-zzzzz', {});
snaptr('track', 'PAGE_VIEW');
</script>
<!-- End Snap Pixel Code -->
The events on the other hand give something like this:
snaptr('track', 'PURCHASE', {'price': INSERT_PRICE, 'currency': 'INSERT_CURRENCY', 'transaction_id': 'INSERT_TRANSACTION_ID', 'item_ids': ['INSERT_ITEM_ID_1', 'INSERT_ITEM_ID_2'], 'item_category': 'INSERT_ITEM_CATEGORY', 'number_items': INSERT_NUMBER_ITEMS, 'uuid_c1': 'INSERT_UUID_C1', 'user_email': 'INSERT_USER_EMAIL', 'user_phone_number': 'INSERT_USER_PHONE_NUMBER', 'user_hashed_email': 'INSERT_USER_HASHED_EMAIL', 'user_hashed_phone_number': 'INSERT_USER_HASHED_PHONE_NUMBER'})
You’d have to insert this on whichever pages you need it. I guess maybe I could create a separate custom html which only fires upon submitting our booking form which includes all of the above, or is there some better way to approach this? The URL after a booking is made is identical to pre-posting, so can’t base it on URL matching.
I couldn’t find any custom event tags for snap on your instance for mentioned above website.
Have you tried sending that event with custom html and custom trigger? It looks like pretty standard 3rd party implementation of tracking.
Yeah, I haven’t implemented it, as I was unsure of how to approach it (pluss for 2 hours yesterday I was troubleshooting Snapchat saying the main tag wasn’t installed correctly while it was
). I’ll try just adding the second batch of code using custom html and a trigger and see how that goes.