Hi
We have a website that is used both in schools and by members of the public.
Currently we are unintentionally signing up school pupils to marketing emails, so in order to prevent this we want to unsubscribe student accounts from marketing emails.
this is the code we have so far
_hsq.push([
'identify',
{
email,
id,
unsubscribeFromAll: isStudent ? 'true' : 'false',
},
]);
_hsq.push(['trackEvent', { id: 'login', email }])
but this does not work.
Can you let me know what the correct way to do this is?
Many Thanks
James Smith
Enhance your core classes or elevate your CS and CTE courses with interactive, standards-aligned lessons that seamlessly integrate STEAM and core subjects. Our content connects classroom learning to real-world topics and essential skills, sparking...
@James-Pi-Top
How is everyone being signed up for these marketing emails currently?
There is an endpoint for subscription preferences here
Might also be able to enroll students in a workflow to remove from subscriptions?
@James-Pi-Top have you considered using a workflow on a custom property named ‘isStudent’ ?
Also, make sure you can update contact properties using the tracking code AP: Update contact properties through the tracking code API .