Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Populating dynamic redirect in landing pages

$
0
0

We have a large survey which I have divided into 3 forms. On completion of each smart capture form I am trying to append some personalised elements so they get picked up in the next form so we can join all the answers to the same person.

In the body of each page I have the following declared variables which are working:

%%[  var @CRM_ID, @GROUP, @EMAIL_ADDRESS  set @CRM_ID = RequestParameter("CRM_ID")  set @GROUP = RequestParameter("GROUP")  set @EMAIL_ADDRESS = RequestParameter("EMAIL_ADDRESS")]%% 

In the submission redirect URL however I have tired all the following without joy so can anyone help?

Try 1

%%=TreatAsContent(Lookup('APAC_HKG_SURVEY_201907','CRM_ID','EMAIL_ADDRESS',@EMAIL_ADDRESS))=%%

try 2

http://cloud.info.timeout.com/survey2_readership2019?EMAIL_ADDRESS=(%%=TreatAsContent(Lookup('APAC_HKG_SURVEY_201907','EMAIL_ADDRESS','EMAIL_ADDRESS',@EMAIL_ADDRESS))=%%)&CRM_ID=(%%=TreatAsContent(Lookup('APAC_HKG_SURVEY_201907','CRM_ID','EMAIL_ADDRESS',@EMAIL_ADDRESS))=%%)"

Try 3

%%=TreatAsContent(concat("http://cloud.info.timeout.com/survey2_readership2019?, 'EMAIL_ADDRESS=', @EMAIL_ADDRESS, '?CRM_ID=', @CRM_ID, '"')=%%

Try 4

https://cloud.info.timeout.com/survey_readership201907c?EMAIL_ADDRESS=(%%EMAIL_ADDRESS%%)&CRM_ID=(%%CRM_ID%%)

This sits in the smart capture form and is triggered on form submission. The full SFMC smart capture script related to this is:

<script id="smartcapture-script-qs33bgfumr">    var scFormLoaded = function () {        window.ScForm.init({"gearID": "qs33bgfumr","smartCaptureFormID": 215,"sourceKey": "2FE6EB4B-A0E0-46AB-8A46-BE365F2047D1","source": "dataExtension","triggeredSend": "","confirmationMessage": "<div style=\"text-align: center;\">\n\t<br />\n\t<br />\n\t<br />\n\tThank you for your submission.</div>","buttonText": "NEXT","formStyling": {"background-color": "transparent","margin-top": "0px","margin-right": "0px","margin-bottom": "0px","margin-left": "0px","padding-top": "0px","padding-right": "0px","padding-bottom": "0px","padding-left": "0px","text-align": "left"            },"fieldStyling": {"width": "200px"            },"buttonStyling": {"background-color": "#FF0000","border-color": "#FF0000","border-radius": "3px","border-style": "solid","-webkit-border-radius": "3px","-moz-border-radius": "3px","color": "#FFFFFF","font-family": "Arial, Helvetica, sans-serif","font-size": "16px","line-height": "normal","padding": "10px"            },"onSubmitShouldGotoUrl": true,"onSubmitGotoUrlType": 2,"onSubmitGotoUrl": "THIS IS WHERE I NEED TO PUT THE REDIRECT URL"        });    };    window.appDomain = window.appDomain || '<ctrl:eval>Platform.Variable.GetValue("@appDomain")||""</ctrl:eval>';    window.contentDetail = window.contentDetail || <ctrl: eval>Platform.Variable.GetValue('@contentDetail')||{}</ctrl: eval >;    if (!window.ScForm || !window.ScForm.init) {        var head = document.getElementsByTagName('head')[0];        var id = 'smartcapture-formjs-script';        var script = document.getElementById(id);        var domain = window.appDomain;        var el;        if (!script) {            if (domain) {                domain = '//'+ domain;            }            el = document.createElement('script');            el.async = true;            el.id = id;            el.src = domain +'/CloudPages/lib/smartcapture-formjs.js';            el.onload = scFormLoaded;            head.appendChild(el);        } else {            if (script.addEventListener) {                script.addEventListener('load', scFormLoaded);            } else if (script.attachEvent) {                script.attachEvent('onload', scFormLoaded);            }        }    } else {        scFormLoaded();    }</script>

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>