Skip to content

Instantly share code, notes, and snippets.

View PardotGists's full-sized avatar

Pardot Gists PardotGists

View GitHub Profile
%%form-if-thank-you%%
%%form-javascript-focus%%
%%form-thank-you-content%%
%%form-thank-you-code%%
%%form-end-if-thank-you%%
<form action="%%form-action-url%%" method="post">
%%form-opening-general-content%%
%%form-if-display-form%% ...
%%form-if-thank-you%%
%%form-javascript-focus%%
%%form-thank-you-content%%
%%form-thank-you-code%%
%%form-end-if-thank-you%%
case '<strong>Live Demo</strong>':
document.location='http://www.yoursite.com/thank-you-live-demo/';
break;
<script type="text/javascript">
//<![CDATA[
setTimeout(function() {
function getUrlParameter(parameterName) {
var queryString = document.URL;
var parameterName = parameterName + "=";
if (queryString.length > 0) {
var begin = queryString.indexOf(parameterName);
if (begin != -1) {
begin += parameterName.length;
<apex:page standardcontroller="Account" showHeader="false" sidebar="false" standardStylesheets="false">
<style>
Body { Background: transparent; }
</style>
<apex:iframe src="https://pi.pardot.com/listProspect/crm/email/{!URLENCODE(Account.PersonEmail)}?sessionid={!$Api.Session_ID}&serverurl={!$Api.Partner_Server_URL_90}&source=salesforce&tab=lead&style={!$User.UIThemeDisplayed}" scrolling="false" height="390" id="prospect_insight"/>
</apex:page>
@PardotGists
PardotGists / gist:fcaa34ddc8bc3d0486f0
Created October 12, 2015 20:40
2127277-setting-up-salesforce-person-accounts-for-pardot-syncing-part4.js
<apex:page standardcontroller="Account" showHeader="false" sidebar="false" standardStylesheets="false">
<style>
Body { Background: transparent; }
</style>
<apex:iframe src="https://pi.pardot.com/qwerly/socialData/email/{!URLENCODE(Account.PersonEmail)}?sessionid={!$Api.Session_ID}&serverurl={!$Api.Partner_Server_URL_90}&source=salesforce&tab=lead&style={!$User.UIThemeDisplayed}" height="390" scrolling="false" id="prospect_insight"/>
</apex:page>
<apex:page standardcontroller="account" showHeader="false" sidebar="false" standardStylesheets="false">
<style>
Body { Background: transparent; }
</style>
<apex:iframe src="https://pi.pardot.com/prospect/activity/email/{!URLENCODE(Account.PersonEmail)}?sessionid={!$Api.Session_ID}&serverurl={!$Api.Partner_Server_URL_90}&source=salesforce&tab=contact&style={!$User.UIThemeDisplayed}" scrolling="false" height="390" id="prospect_insight"/>
</apex:page>
/**
* This class contains unit tests for validating the behavior of Apex classes
* and triggers.
*
* Unit tests are class methods that verify whether a particular piece
* of code is working properly. Unit test methods take no arguments,
* commit no data to the database, and are flagged with the testMethod
* keyword in the method definition.
*
* All test methods in an organization are executed whenever Apex code is deployed
trigger LogPersonAccountChange on Account (before delete, after insert, after undelete)
{
List<pi__ObjectChangeLog__c> logs = new List<pi__ObjectChangeLog__c>();
if (Trigger.new != null) {
for (Account account : Trigger.new) {
if (Account.PersonEmail != null && Account.PersonEmail != '') {
pi__ObjectChangeLog__c log = new pi__ObjectChangeLog__c();
log.pi__ObjectFid__c = Account.PersonContactId;
@PardotGists
PardotGists / 2127262-integration-google-site-search1.js
Created September 28, 2015 13:21
Integrating Google Site Search Example 1
<script>
(function() {
var cx = 'YOUR_GOOGLE_SEARCH_ENGINE_ID_HERE';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);