0

I’m looking to redirect a user from a Marketing Cloud Landing Page if a certain string such as "/eb=1&eb_timestamp=" is contained in the url.

I’m struggling with this and would really appreciate any help from the community on what I need to add to my page.

Scenario, users arrives to url https://landing.landingpage.com/eb=1&eb_timestamp= and the string has been concatenated to the main url, as a result they get redirected to http://landing.landingpage.com/home

I’m struggling with this and would really appreciate any help from the community on what I need to add to my page.

1
  • 3
    This doesn't make much sense. You want to test whether the query string provided is "?eb=1&eb_timestamp=" or the url ends with "/eb=1&eb_timestamp=" (broken url). I'm presuming the "/" is a typo?
    – Macca
    Sep 16 '20 at 15:05
1

I'd approach it this way:

%%[

var @dc
var @pageURL
var @debug

set @debug = 1
set @dc = QueryParameter("dc")
set @pageURL = RequestParameter('PAGEURL')

if @debug == 1 then
  output(concat("<br>pageURL: ", @pageURL))
  output(concat("<br>dc: ", @dc))
  output(concat("<br>index: ", indexOf(@pageURL, "dc_timestamp")))
endif

if @dc == "1" and indexOf(@pageURL, "dc_timestamp") > 0 then

  if @debug == 1 then
    output(concat("<br>redirecting..."))
  else
    redirect("https://ampscript.guide")
  endif

endif

]%%
1
  • Thanks very much, this is great
    – EBern
    Sep 18 '20 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.