This question has been answered by multiple community members. See the first response.
[[$[[*TvName]]]]
<?php
$from = $_SERVER['HTTP_REFERER'];
$chunk = 'home_chunk';
If (strstr($from, 'facebook') !== false) {
$chunk = 'facebook_chunk';
}
$output = $modx->getChunk($chunk);
return $output;
$modResource->render()
$templateVariable->renderOutput()
$resource->GetTVValue($tvId);
$modx->resource->GetTVValue($tvId);
<?php
$from = $_SERVER['HTTP_REFERER']; // note, $_SERVER anything can be forged
if (strpos($from, 'facebook.com') !== false) {
$id = 12; // id of campaign page to be displayed
$url = $modx->makeUrl($id);
$modx->sendRedirect($url);
}
if (strpos($from, 'google.com') !== false) {
$id = 14; // id of campaign page to be displayed
$url = $modx->makeUrl($id);
$modx->sendRedirect($url);
}