Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted May 15, 20186 yr Hi, IPB currently sets a cookie which has the ips4_member_id stored, I would like to also set the member group? Does anyone know how I'd do this? Thanks
May 15, 20186 yr Author I want to use an ad platform which works behind their DNS, they dynamically intercept the request, edit and serve. I want to stop the serving of ads to a certain user group which they'd be able to lookup from a cookie.
May 15, 20186 yr Is the ad being placed using the IPS advertisement functionality? If so, use the group setting on the ad there instead.
May 15, 20186 yr Author Hi Nathan, the ad system (Ezoic) sits entirely outside of my server and code. The code isn't touched at all. The original server request is intercepted.
May 15, 20186 yr Would they be able to pick up the group from a javascript variable in the html instead?
May 15, 20186 yr If you want to put the user's group into a cookie, you have a few things to consider. 1) You'd need to write a plugin to do this, as it doesn't happen out of the box. It's not difficult to do so, but it would be necessary. 2) Users can belong to multiple groups, so you'd want to set all of those groups and be sure your ad platform can read all of them. Whether that's a comma separated list or some other format though, you'd have to check with the ad platform.
May 17, 20186 yr Author On 5/15/2018 at 7:54 PM, Nathan Explosion said: Would they be able to pick up the group from a javascript variable in the html instead? Good idea @Nathan Explosion, will check, hadn't thought to ask that. On 5/15/2018 at 11:17 PM, bfarber said: If you want to put the user's group into a cookie, you have a few things to consider. 1) You'd need to write a plugin to do this, as it doesn't happen out of the box. It's not difficult to do so, but it would be necessary. 2) Users can belong to multiple groups, so you'd want to set all of those groups and be sure your ad platform can read all of them. Whether that's a comma separated list or some other format though, you'd have to check with the ad platform. Thanks @bfarber, seems like I've got a lot to learn then. Thought it might be as easy as adding a line of code to the existing method of setting the cookie.
May 30, 20186 yr Author Hi @Nathan Explosion I didn't think about this before, but a JS variable would work as I could use Google Tag Manager to create the cookie. Would this be an easier method and how would I go about this? Thank you
May 30, 20186 yr In a template to use just the primary group: <script> var groupId = {expression="\IPS\Member::loggedIn()->member_group_id"}; </script> or for all group ids (comma-separated): <script> var groupIds = "{expression="implode( ',', \IPS\Member::loggedIn()->groups )"}"; </script>
Archived
This topic is now archived and is closed to further replies.