We are builing landing pages using ampscript to unsubscribe email address submitted via these pages. The pages should check for email address to existing subscriber and unsubscirbe them or create new subscriber on All Subscriber List
This works fine when the landing pages are on Enterprise Admin account. But the landing pages behave strangely when we localize it to one of child bus unit. The api create/update calls show success but the subscriber cannot be found in the UI. Can one the dev team assist here with code placed under child business unit or should all the landing pages be on the parent account. The mid is always changed to whatever bus unit the landing page is accessed from. Thanks Below is code sample
/* ===================================================== *//* CREATE SUBSCRIBER OBJECT *//* ===================================================== */SET @sub = CreateObject("Subscriber")SetObjectProperty(@sub, "SubscriberKey", @subkey)SetObjectProperty(@sub, "EmailAddress", @e)SetObjectProperty(@sub, "Status", "Unsubscribed")/*SetObjectProperty(@sub, "Status", "Active")*//* ===================================================== *//* CREATE CLIENT OBJECT *//* ===================================================== */SET @cid = CreateObject("ClientID")SetObjectProperty(@cid, "ID", @mid)SetObjectProperty(@sub, "Client", @cid) /* ===================================================== *//* INVOKE CREATE *//* ===================================================== */SET @statusCode = InvokeCreate(@sub, @statusMsg, @errorCode)IF @TestMode == true THEN]%%<b>InvokeCreate Subscriber/Client</b> Object statusCode : %%=v(@statusCode )=%%<br/><b>InvokeCreate Subscriber/Client</b> Object errorCode: %%=v(@errorCode)=%%<br/><b>InvokeCreate Subscriber/Client</b> Object statusMsg: %%=v(@statusMsg)=%%<br/><br/><br/> %%[ENDIF/* ===================================================== *//* INVOKE UPDATE *//* ===================================================== */IF @statusCode == "Error" THEN set @type = "update" SET @statusCode = InvokeUpdate(@sub, @statusMsg, @errorCode)ENDIFIF @TestMode != true THEN IF @statusCode == "Error" THEN Redirect(@error_url) ENDIFENDIF