0

EDIT:
Found the cause:

background-image: url('')

in the html element on the landing page somehow caused the page to relaod and execute AMPscript twice in this process. I got rid of that and AMPscript execution works fine. Tested for Chrome 57.0.2987.133.

Original question:
It seems that AMPScript on my microsite is executed twice. To test this behaviour I created test data extension with one text field and landing page within microsite that inserts rows into that data extension. The landing page was created using design view and AMPScript was placed there in HTML gear. AMPScript code:

%%[
    var @testValue
    set @testValue = RequestParameter("test")
    InsertData("TestIfDouble", "test", @testValue)
]%%

%%=v(@testValue)=%%

When I open this landing page, two values are put into DE, e.g. when I open https://pub.s7.exacttarget.com/fffffffffff?test=value my DE consists of records: "value" and "value/sitemap.json".

Strangely, if I open the same url, with additional parameter, e.g. https://pub.s7.exacttarget.com/fffffffffff?test=value&test2=value2, "value" is still being put twice, but with no "/sitemap.json", so my DE has two records: "value" and "value".

Another case is when @testValue is static, like:

%%[
    var @testValue
    set @testValue = "staticValue"
    InsertData("TestIfDouble", "test", @testValue)
]%%

%%=v(@testValue)=%%

Then it is inserted only once.

Even when using different browser (tested for Chrome and Firefox) and with QueryParameter, problem persists. I've done some additional testing and it turns out, that double execution happens only on design view landing page, within microsite. Standalone landing page (code view as well as design view) and code view landing page on microsite insert value only once.

  • I can't reproduce this. I've replicated your scenario and it only inserts one record. Do you have your AMPsccript in an HTML Gear in Design View? Have you tried using a different browser to load the page? If you try replacing RequestParameter with QueryParameter do you still get the same behavior? – Eliot Harper Feb 22 '17 at 22:30
  • @EliotHarper thank you for your reply. I have my AMPScript in HTML Gear on design view landing page on microsite (Cloud Pages). Even when using different browser (tested for Chrome and Firefox) and with QueryParameter, problem persists. I've done some additional testing and it turns out, that double execution happens only on design view landing page, within microsite. Standalone landing page (code view as well as design view) and code view landing page on microsite insert value only once. – kolatajp Feb 23 '17 at 9:41
  • That's good news that you have isolated this. Please can you create an answer from your findings, for the benefit of others? – Eliot Harper Feb 23 '17 at 17:38
  • Sure I'll add this findings to my question, but I still wanted this ampscript in design view on microsite, changing to separate landing page doesn't fully resolves the problem. – kolatajp Feb 27 '17 at 8:40
  • Found the cause, added answer to original question. – kolatajp Apr 28 '17 at 10:13
1

Found the cause:

background-image: url('')

in the html element on the landing page somehow caused the page to relaod and execute AMPscript twice in this process. I got rid of that and AMPscript execution works fine. Tested for Chrome 57.0.2987.133.

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.