Salesforce表单传递GA数据

时间:2016-08-25 19:18:08

标签: google-analytics salesforce

我正在使用Salesforce的Web-to-lead功能。它基本上创建了一个表单,用于在每次提交的新引导中输入数据。我想知道如何在下面的代码中动态填充隐藏字段(参考网址,着陆页网址,GA源/媒体/广告系列)

我尝试了this blog post上建议的代码,但未成功。

这就是表格形式的html:

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="XXXXXXXXXXXXXXX">
<input type=hidden name="retURL" value="/thankyou.html">

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

<label for="phone">Phone</label><input  id="phone" maxlength="40" name="phone" size="20" type="text" /><br>

<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" /><br>

<label for="title">Title</label><input  id="title" maxlength="40" name="title" size="20" type="text" /><br>

<div style="display:none;">

<label for="lead_source">Lead Source</label><select  id="lead_source" name="lead_source">
<option value="Quotefx Web Inquiry" selected>Web Inquiry</option>
</select><br>

Refer URL:<input  id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>

Landing Pg URL:<input  id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>

GA Medium:<input  id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>

GA Source:<input  id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>

GA Campaign:<input  id="XXXXXXXXXXXXXX" maxlength="255" name="XXXXXXXXXXXXXX" size="20" type="text" /><br>
</div>

<input type="submit" name="submit">

</form>`

0 个答案:

没有答案