11
votes
Accepted
Possible to Set Access-Control-Allow-Origin in an SFMC Landingpage?
I found out a Solution.
Its possible to Set the Header using Server-Side JavaScript within the Landingpage.
Here is my Header and its working fine now.
<script runat=server>
Platform.Load("...
11
votes
Accepted
CSS file upload and store in Marketing Cloud
Within your Cloud Page collection, you can create a Code Resource:
After you fill out the name of the code resource, you can select the type, which in your case will be CSS:
You will now be able to ...
10
votes
Accepted
Developing and testing CloudPages
I use the HTTPGET() AMPScript function to pull in the content from an external web server when developing pages. Like this:
%%=TreatAsContent(HttpGet(Concat("http://example.com/your-page.html?x=",...
10
votes
Accepted
Parameters passed in CloudPagesURL
I'd say most (if not all) of the Email, Email Date, Subscriber, and Sender personalization strings are included -- as are any attributes or data extension column names passed over in the send context....
7
votes
Accepted
Send data from de in email to landing page
You're mixing inline AMPscript notation in an AMPscript block. That won't work.
But, you don't need the AMPScript block in your email at all since the CloudPagesURL() function will handle everything....
6
votes
Accepted
Trigger email from Landing Page via AMPScript
You can use AMPScript and the SOAP API web service to accomplish this. It is fairly easy to do, you create the triggered send in the UI or via SDK or API. Then inside the AMPscript on your page you ...
6
votes
how to query for contact of a customer portal user or community user
There is no User.Contact field, instead you have to user User.ContactId
userId = System.currentPagereference().getParameters().get('uId');
User u = [SELECT u.Id,u.ContactId,u.IsActive
FROM ...
6
votes
Accepted
Using AMPscript on Landing Pages
You need to print the variable using
%%=v(@id)=%%
And not
%%[=v(@id)=]%%
6
votes
Accepted
Assigning BLANK/NULL value for Date field in Marketing cloud - Data extension
This is mandatory and expected behavior.
As SFMC data extensions are based off SQL tables, the date/time field types have an auto-assigned default value. By having it empty, the system will default ...
5
votes
Web Analytics Connector breaking custom unsubscribe page when clicked within email
Here's another workaround for this bug with the CloudPagesURL() function.
Within the body of the email that drives the subscriber to the CloudPages landing page, create the query string parameter ...
5
votes
Accepted
AMPScript loop in a landing page
To clarify, you don't need a Primary Key when using LookupRows or LookupOrderedRows, but you do need a column in your data to match rows against (which has to be an exact match). This is a little ...
5
votes
How to insert multiple records from Exacttarget microsite to Salesforce?
The SObject Tree only handles single records and you need to use this method for multiple records.
However, I'm not sure why you don't simply use the CreateSalesforceObject AMPscript function instead,...
5
votes
Accepted
Created a landing page as code resource for CSS in Marketing cloud Cloud pages. I need to find out the page ID for this page
1. Classic Editor
Within CloudPages collection the page ID for CSS can be found by inserting the CSS resource into a landing page.
Here are the steps involved:
First create a landing page through the ...
5
votes
Accepted
Can we capture click activity of links in landing pages and generate reports based on the click activities of these links?
You can't track outbound links from Cloud Pages, as they are not being redirected through the tracker domain, unlike links from emails. If you want, you can create a custom solution, where you will ...
5
votes
Accepted
How can I fetch code for a Cloud Page from a file on Dropbox?
Append ?dl=0&raw=1 to the end of the dropbox url and insert between your TreatAsContent and HTTPGet functions as such:
%%=TreatAsContent(HTTPGet('https://www.dropbox.com/s/abcdefghijk123/my_page....
4
votes
Receiving HTTP Post data and storing in a Data Extension
If you're comfortable using SSJS, Platform.Request.GetPostData(), conveniently missing from the documentation, will return the whole post body as a string. To parse that data into an object, pass the ...
4
votes
Accepted
Landing Page post to itself and run SSJS
There are various ways this might work. Here are a couple of examples...
AMPScript
%%[ IF @@ExecCtx == "LOAD" THEN]%%
<form action="%%=RequestParameter('PAGEURL')=%%"> method="post">
...
4
votes
Accepted
Use Javascript on landing page
In this case I'd try to use Javascript within the html page. Basically here is the sample code.
I have seen issues when you try to reference js externally using landing pages and microsites which is ...
4
votes
Accepted
How does Ampscript RaiseError function work?
Straight from the docs:
Explanation of the function
Raises the error given in string and stops processing of job. If
optional B1 is included with a value of true, this function stops the
send ...
4
votes
How to pass subscriber info to SSJS in landing page
No need to do the AMPscript block first.
The SSJS has the same context as the AMPscript block. You can just retrieve them directly with Attribute.GetValue():
<script runat="server">
...
4
votes
Accepted
Update Data Extension after clicking on an email link
As I was saying on the Marketing Cloud group, an easy way to achieve this is to have landing page between your link and your destination page. The page is hosted on Cloudpages and can perform ...
4
votes
Passing subject line to view_email_url landing page
There is no way for a user to change this title in a View as Web Page (VAWP) link as this is autogenerated by SFMC. You could talk to your account rep and see if there is anything they can do to ...
4
votes
Accepted
In a SalesForce Marketing Cloud landing page is there a way to track if a page has been viewed before
There are several different approaches to this. You could query the Click Data View, but considering that data is only retained for 6 months, it could be safer to track clicks yourself, in a DE.
The ...
4
votes
Accepted
Limit Records in a data extension
For the data extension limit, you can wrap the whole page and logic inside an AMPscript block. This block would lookup to your DE and if count is greater then 300 then show the 'sorry maximum has been ...
4
votes
SFMC Cloudpage Execution Context is always load
According to the Ampscript guide:
In the current release of Marketing Cloud, the @@ExecCtx variable will
always return load, irrespective of the context. This is a known issue
and should be ...
4
votes
Accepted
SFMC Cloudpage Execution Context is always load
You can use the solution where you set a hidden parameter in your form, e.g.:
<input type="hidden" id="submitted" name="submitted" value="submitted">
Once submitted, you check for the ...
4
votes
Accepted
Data extension row retrieval
If you need just the total rowcount of your dataextension, you can utilize DataExtensionRowCount()
In which case you just:
set @neededNumber = DataExtensionRowCount('TableName')
This is optimal as ...
4
votes
Accepted
Unable to fetch the Job ID for a landing page
As @zuzannamj stated in comments. Your solution is to utilize the CloudPagesURL() function in AMPscript.
Basically it would change your 'email code' to:
Hi,<br>
<br>
%%[
SET @Sub = ...
3
votes
Trigger send after submit from Smart Capture in Cloud Pages?
Triggered sends do work with Cloud Pages/Smart Capture. A popular use case is "welcome" signup emails after form submit. However, the form needs to be built using the "classic" landing page form tools ...
3
votes
Accepted
How can I pass data to a Salesforce Marketing Cloud Smart Capture form via URL parameters?
This is briefly explained in the Smart Capture documentation. In short, you will need to:
Pass the location name as a URL parameter to the landing page, for example, http://pages.example.com?location=...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
landing-page × 248marketing-cloud × 217
ampscript × 95
cloudpage × 48
ssjs × 24
dataextensions × 20
smart-capture × 14
microsites × 11
javascript × 10
email × 9
triggered-send × 7
form × 7
rest-api × 6
css × 6
cloudpagesurl × 6
api × 5
journeybuilder × 5
pardot × 5
survey × 5
error × 4
visualforce × 3
lightning × 3
community × 3
email-template × 3
html × 3