{"id":31604,"date":"2018-04-21T15:47:49","date_gmt":"2018-04-21T15:47:49","guid":{"rendered":"https:\/\/ampscript.guide\/authenticatedmemberid\/"},"modified":"2021-04-06T00:58:50","modified_gmt":"2021-04-06T00:58:50","slug":"authenticatedmemberid","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/authenticatedmemberid\/","title":{"rendered":"AuthenticatedMemberID"},"content":{"rendered":"<h2>AuthenticatedMemberID<\/h2>\n<p>This function returns the MID of the Marketing Cloud account, based on the context of the authenticated user&#8217;s session. This is useful when creating customized pages for child Business Units (a feature available in earlier Enterprise 2.0 accounts).<\/p>\n<h3>Arguments<\/h3>\n<p><code>AuthenticatedMemberID()<\/code><\/p>\n<p>This function does not accept any arguments.<\/p>\n<blockquote>\n<p>NOTE: This function will only return the correct value when used in classic landing pages or microsites (a feature available in earlier Enterprise 2.0 accounts). When used in CloudPages, it will return the MID value of the Business Unit where the page is published, not the MID value based on the context of the authenticated user accessing the published URL.<\/p>\n<p>TIP: You can also use the <code>memberid<\/code> <a href=\"\/sender-data-strings\">personalization string<\/a> to display the related Business Unit MID of a published landing page or code resource.<\/p>\n<\/blockquote>\n<h3>Example<\/h3>\n<p>The following example displays the Business Unit MID on a customized page, based on the context of the authenticated user.<\/p>\n<pre><code>%%[\n\nvar @MemberID\n\nset @MemberID = AuthenticatedMemberID()\n\n]%%\n&lt;p&gt;This Business Unit MID is %%=v(@MemberID)=%%.&lt;\/p&gt;<\/code><\/pre>\n<h4>Output<\/h4>\n<p>The function returns the Business Unit MID based on the context of the authenticated user&#8217;s Marketing Cloud session (see note).<\/p>\n<pre><code>&lt;p&gt;This Business Unit MID is 10987456.&lt;\/p&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AuthenticatedMemberID This function returns the MID of the Marketing Cloud account, based on the context of the authenticated user&#8217;s session. This is useful when creating customized pages for child Business Units (a feature available in earlier Enterprise 2.0 accounts). Arguments AuthenticatedMemberID() This function does not accept any arguments. NOTE: This function will only return the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The AMPscript Guide - AuthenticatedMemberID<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ampscript.guide\/authenticatedmemberid\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - AuthenticatedMemberID\" \/>\n<meta property=\"og:description\" content=\"AuthenticatedMemberID This function returns the MID of the Marketing Cloud account, based on the context of the authenticated user&#8217;s session. This is useful when creating customized pages for child Business Units (a feature available in earlier Enterprise 2.0 accounts). Arguments AuthenticatedMemberID() This function does not accept any arguments. NOTE: This function will only return the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/authenticatedmemberid\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-06T00:58:50+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ampscript.guide\/#website\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"The AMPscript Guide\",\"description\":\"The Definitive Scripting Manual for Salesforce Marketing Cloud\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ampscript.guide\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/\",\"name\":\"The AMPscript Guide - AuthenticatedMemberID\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:49+00:00\",\"dateModified\":\"2021-04-06T00:58:50+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/authenticatedmemberid\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/\",\"url\":\"https:\/\/ampscript.guide\/authenticatedmemberid\/\",\"name\":\"AuthenticatedMemberID\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\",\"name\":\"dev\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31604"}],"collection":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/comments?post=31604"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31604\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}