Salesforce Marketing Cloud Preference Center: AMPScript thiab Cloud Page Piv Txwv

AMPscript Salesforce-Kev Sib Tham Ua Lag Luam Huab Huab Txoj Cai Lub Npe

Cov dab neeg tseeb… kuv txoj haujlwm yeej coj tawm kaum xyoo dhau los thaum kuv tau pib txoj haujlwm ua Tus Kws Pab Tswv Yim Kev Sib Tham rau ExactTarget (tam sim no Salesforce Marketing Cloud). Kuv txoj haujlwm tau coj kuv thoob plaws lub ntiaj teb pabcuam cov tuam txhab hauv kev tsim cov kev sib sib zog nqus nrog lub platform thiab kuv tau tsim ntau cov koom haum paub txog ntawm lub platform uas kuv tau raug txhawb los ua tus thawj tswj khoom.

Cov kev sib tw ntawm Tus Thawj Tswj Khoom Muag rau ib lub koom haum uas yav dhau los ua tus tsim-ua tus kawg nws coj kuv mus. Nws yog ib lub koom haum loj, tab sis kuv yeej tsis muaj tiag muaj cov khoom. Yog li, thaum kuv cov phooj ywg hauv kev txhawb nqa, muag, thiab cov khoom lag luam tau saib rau kuv kom muaj kev hloov pauv tiag tiag ... qhov kev muaj tiag yog pab pawg txhim kho feem ntau siv txoj kev daws teeb meem sib txawv thiab kuv xav pom tawm hnub ua ntej tso tawm.

Ib qho ntawm kuv txoj haujlwm kawg tau ua haujlwm ntawm kev sib tham sab hauv lub platform uas yuav ua rau peb cov neeg siv khoom ntxiv sau ntawv rau lawv cov email. Kuv tau ua haujlwm nrog lwm tus thawj tswj khoom thiab peb tau ua ib qho kev tshawb fawb… nws thiaj li txiav txim siab los tsim ib qho kev ua JQuery-style mus nrog peb tus kheej txoj haujlwm, tab sis suav nrog kev muaj peev xwm dhau thiab haus cov kab, siv JSON, thiab lwm yam. Nws tau mus yuav zoo heev kev daws ... kom txog rau thaum nws ntaus kev loj hlob. Thaum ntxov hauv lub voj voog cov khoom lag luam, kuv lub tsev qiv ntawv tau tawg pov tseg thiab tus neeg tsim khoom laus hloov nws nrog AMPscript.

Xyoo tom qab, tus Salesforce Partner tuam txhab Kuv yog tus khub hauv yog tam sim no ua cov txheej txheem nyuaj, cov kev sib koom ua ke, thiab kuv pom kuv tus kheej mired nyob rau hauv AMPscript nyob rau txhua hnub - yog txhim kho email cov ntsiab lus kev sib txuas lossis dov tawm Huab Nplooj. Yog lawm, qhov kev poob siab ntawm kev ua haujlwm nruab hnub thiab nruab hnub nrog AMPscript ua rau kuv tias qhov kev txiav txim siab tsis ncaj ncees tau rov qab rau cov hnub ntawd ... kuv txoj kev daws teeb meem yuav zoo dua li tsis muaj qab hau. Kuv xav tias zoo li kuv rov qab los rau hauv lub TRS-80 hauv BASIC.

Cov khoos phis uas koj siv rau Cov nplooj ntawv huab yog unforgiving. Nws tsis ntes cov teeb meem yooj yim xws li tshaj tawm cov lej hloov lossis teeb meem yuam kev hauv syntax nrog koj cov cai. Qhov tseeb, koj muaj peev xwm luam tawm ib nplooj ntawv uas tsuas yog tsim qhov kev ua yuam kev 500 server. Tseem muaj ob lub npe tis npe rau koj cov nplooj ntawv… tsis txhob nug kuv tias vim li cas.

Pro-ntsis: Yog tias Huab Nplooj tsis txhob rov qab ua cov qauv ntaub ntawv thaum koj yuav tsum tshaj tawm thiab nws zoo li nws ua tiav mus ib txhis ... koj yuav pov qhov yuam kev. Yog tias koj luam tawm ib qho twg, koj yuav raug yuam kom lwv tawm Cov Huab Huab Huab Nplooj thiab suav daws dua. Kuv twv yog tias cov cuab yeej tsim kho uas ua rau tsis yog ntse txaus los txheeb xyuas qhov hloov chaw thiab tsuas yog ua cov txheej txheem cached code.

Ib cag los ntawm qhov ntawd, koj yuav zoo siab tau paub ntau yam ntawm cov qauv ntaub ntawv cov cai muaj lawv tus kheej cov ntawv tsis raug. Yij! Nws yog qhov kev paub tsis zoo… tab sis koj tuaj yeem siv thiab yuav tsum siv nws vim tias nws muab qee qhov yooj yim hloov tau.

Sab ntawv tseem ceeb: Muaj Nplooj Sab Tshiab kev… Qhov twg zoo li lawv nyuam qhuav rov nplooj nplooj thiab nws tsis muab cov ntaub ntawv ntxiv. Kuv yeej nyiam lub qub version zoo dua rau cov kauj ruam tshaj tawm ua ntu zus.

Thaum kuv lub tuam txhab Highbridge tsim cov txheej txheem nyuaj, Ajax-qhib cov kev daws teeb meem uas koom nrog ntau lub tshuab thiab sib txuas cov ntaub ntawv txuas ntxiv nrog AMPscript, SSJS, Huab Nplooj, thiab email… Kuv xav qhia qhov piv txwv yooj yim ntawm qhov koj tuaj yeem pib siv tau yooj yim siv AMPscript kom nug koj tus Salesforce piv txwv thiab rub cov ntaub ntawv rov qab. Nyob rau hauv cov ntaub ntawv no, ib qho yooj yim boolean teb uas khaws tus tswv unsubscribe chij. Koj tuaj yeem, ntxiv rau, txuas ntxiv cov cai no los tsim ua tag nrho cov nplooj ntawv nyiam lossis nplooj ntawv profile uas koj tuaj yeem siv.

Tsim Cov Huab-Nplooj Ntawv Txuas nrog Cov Ntawv Siv Cov Ntaub Ntawv

Yog tias koj saib koj Cov Lus Qhia Sab Huab, koj tuaj yeem tau txais qhov tshwj xeeb nplooj ntawv ID rau nplooj ntawv uas koj tuaj yeem suav nrog hauv koj cov emails.

huab nplooj id

Lub syntax yog raws li nram no:

<a href="%%=RedirectTo(CloudPagesURL(361))=%%">View My Preferences</a>

AMPscript rau Salesforce Cov Ntaub Ntawv ntawm Huab Nplooj ntawm Cov Ntawv Ntxiv

Thawj kauj ruam tab tom tsim koj li AMPscript kom tshaj tawm cov tsiaj ntawv thiab khaws cov ntaub ntawv los ntawm Salesforce los siv rau hauv koj nplooj ntawv. Hauv qhov ua piv txwv no, Kuv daim teb Salesforce boolean uas tuav qhov tseeb lossis cuav raug npe OptedOut:

%%[

/* Declare EVERY variable */
VAR @contactKey,@agent,@referrer,@unsub
VAR @rs,@updateRecord,@checked
 
/* Request your ContactKey from the querystring */
Set @contactKey = Iif(Empty([_subscriberKey]),RequestParameter("contactKey"),[_subscriberKey])

/* Set unsub to false unless it is passed in the querystring */
SET @unsub = Iif(Not Empty(RequestParameter('unsub')),RequestParameter('unsub'),'false')
 
/* If unsub, then update the Salesforce field OptedOut */ 
IF NOT Empty(@unsub) THEN
  SET @updateRecord = UpdateSingleSalesforceObject('contact',@contactKey,'OptedOut', @unsub)
ENDIF

/* Retrieve the Salesforce Contact record */
Set @rs = RetrieveSalesforceObjects('contact', 'FirstName,LastName,OptedOut', 'Id', '=', @contactKey);
 
/* Get the fields from the record */
 IF RowCount(@rs) == 1 then
  var @record, @firstName, @lastName, @optout
  set @record = Row(@rs, 1)
  set @firstName = Field(@record, "FirstName")
  set @lastName = Field(@record, "LastName")
  set @optout = Field(@record, "OptedOut")
ENDIF

/* Build a string for your checkbox to be checked or not
 set @checked = '';
 IF (@optout == 'true') THEN
  set @checked = 'checked'
 ENDIF
 
]%%

Tam sim no koj tuaj yeem tsim tawm koj HTML thiab daim ntawv uas txheej txheem qhov kev thov:

<!DOCTYPE html>
<html>
   <title>Profile Center</title>
   <body>
      <h2>Your Profile:</h2>
      %%[ if RowCount(@rs) == 1 then ]%%
      <ul>
         <li><strong>First Name:</strong> %%=v(@firstName)=%%</li>
         <li><strong>Last Name:</strong> %%=v(@lastName)=%%</li>
         <li><strong>Unsubcribed:</strong> %%=v(@optout)=%%</li>
      </ul>
      <form method="get">
       <div>
         <input type="hidden" id="contactKey" name="contactKey" value="%%=v(@contactKey)=%%">
         <input type="checkbox" id="unsub" name="masterUnsub" value="true" %%=v(@checked)=%%>
         <label for="masterUnsub">Unsubscribe From All</label>
        </div>
       <div>
         <button type="submit">Update</button>
        </div>
     </form>
      %%[ else ]%%
      <p>You don't have a record.</p>
      %%[ endif ]%%
   </body>
</html>

Ntawd yog nws ... tso nws tag nrho ua ke thiab koj tau txais nplooj ntawv nyiam uas tau hloov tshiab nrog koj cov ntaub ntawv sau npe thiab dhau ib daim ntawv thov hloov kho boolean teb (tseeb / tsis tseeb) hauv Salesforce. Tam sim no koj tuaj yeem tsim kev nug cov lus nug ncig thaj teb ntawd kom nco ntsoov ua kom muaj kev sib cuag uas raug xaiv tawm tsis xa ib qho email!

Yuav Ua Li Cas Txhim Kho Koj Li Nyiam Nplooj Ntawv lossis Chaw Sau Npe

Tau kawg, qhov no tsuas yog teaser ntawm qhov ua tau nrog nplooj ntawv nyiam. Tej zaum koj yuav xav xav txog:

  • Txo cov ntawv tiag tiag los ntawm lwm cov ntaub ntawv txuas ntxiv kom koj pab pawg muag khoom tuaj yeem hloov kho cov ntsiab lus ntawm nplooj ntawv thaum twg lawv xav yam tsis tas yuav kov cov cai.
  • Tshaj tawm cov ntawv tshaj tawm cov ntaub ntawv txuas ntxiv thiab cov voj los ntawm cov ntawv tshaj tawm pub rau xaiv-xaiv lossis xaiv qhov kev nyiam xaiv ntxiv rau tus tswv tsis yeem.
  • Qhia cov laj thawj txuas ntxiv cov ntaub ntawv los txhawm rau ntes koj vim li cas koj cov neeg rau npe yog tswv tsis xeb.
  • Nthuav tawm lwm cov ntaub ntawv cov ntaub ntawv los ntawm cov ntaub ntawv Salesforce muab cov ntaub ntawv qhia ntxiv profile.
  • Ua cov nplooj ntawv nrog Ajax kom koj tuaj yeem seamlessly populate nws.
  • Muab ib qho txhais tau ntawm kev sau npe kom koj tus neeg siv tau nkag mus rau hauv lawv tus kheej qhov chaw profile thaum twg los tau.

Cov Khoom Siv Ntxiv rau AMPscript

Yog tias koj tab tom nrhiav qee qhov kev pab ntxiv rau kev kawm thiab siv cov AMPscript, ntawm no yog ntau yam kev pab:

  • Qhia txog AMPscripte - npaj los ntawm qee tus neeg ua haujlwm ntawm Salesforce, qhov no yog qhov ua tiav cov ntaub ntawv ntawm AMPscript syntax, txawm hais tias cov piv txwv yog lub teeb tiag tiag. Yog tias nws muaj zog dua, nws yuav tsim nyog rau kev nqis peev.
  • Trailhead AMPscript - Salesforce's Trailhead yog qhov kev kawm pub dawb thiab tuaj yeem coj koj los ntawm cov hauv paus ntawm cov lus nrog ob qho AMPscript, SSJS, thiab ob tus neeg tuaj yeem sib cuam tshuam li cas.
  • Khib Kev Muag Khoom Muag Khoom - lub zej zog online zoo rau thov kom pab nrog ib tuj ntawm AMPscript cov qauv kuaj.

Muaj ib tuj ntawm lub sijhawm nyob rau hauv kev koom ua ke nrog koj Huab Nplooj nrog Salesforce los muab cov neeg siv khoom zoo dhau los. Thiab yog tias koj lub tuam txhab tawm tsam, koj tuaj yeem tiv tauj peb los pab!

Tiv tauj Highbridge

Yuav ua li cas koj xav hais tias?

Qhov Web site no siv Akismet los txo cov kev pabcuam. Kawm li cas koj cov ntaub ntawv tawm tswv yim tiav.