Permission: Campaign entities
Sourcepoint's tracking systems can match the website to the property name in your organization's campaign in a few ways. If your organization wishes to use regex commands as part of your targeting in scenario setups this article can help you.
- Matching a website to a property name
- Page URL targeting condition
- Examples - page URL targeting with regex
Matching a website to a property name
Sourcepoint's CMP script implemented on your organization's webpage uses the document.location.href
javascript command to retrieve the URL of the website. It passes this information to our servers where a lookup against a property name is performed to determine whether there is an active campaign.
For this reason it is advantageous to choose property names that match your website URL e.g. 'www.football24.com', 'www.allsports24.com'.
Use of wildcards in property names
Sourcepoint supports the use of wildcards in property names for example, '*.sportsaction.com'.
Websites like 'football.sportsaction.com' and 'basketball.sportsaction.com' can be supported with a single property name '*.sportsaction.com'. Therefore two or more websites can be supported by the same scenario under one property.
Optional
An explicit link to a campaign's property name can be established through the CMP stub code implemented on your organization's webpage. This can be done by adding the propertyHref
parameter to the configuration part and setting its value to the property name in your Sourcepoint campaign.
Please remember that the term 'https://' must precede the full property name in the propertyHref
value.
<script>
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){for(var t,e,o=[],n=window,r=n;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=n.parent}t||(function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))}();
</script>
<script>
window._sp_ = {
config: {
accountId: 7777,
baseEndpoint: 'https://cdn.privacy-mgmt.com',
propertyHref: 'https://football.sportsaction.com',
joinHref: true
}
}
</script>
<script src="https://cdn.privacy-mgmt.com/wrapperMessagingWithoutDetection.js"></script>
An explicit link can also be established by adding the propertyId
parameter to the configuration code and setting its value to the property id in your Sourcepoint campaign.
Note: If you intend to use propertyHref
or propertyId
please remember that these take precedent over your website domain, the Sourcepoint CMP will act using these settings. Please ensure that you set the correct values.
If using propertyHref
in your configuration script, Sourcepoint strongly encourages your organization to add joinHref: true
to your configuration script as well to ensure that all directory regular expression functionality works as intended.
Using propertyHref
or propertyId
could help when testing implementations on pre-production websites prior to actual launch. More information on these parameters can be found here.
Page URL targeting condition
The page URL targeting condition allows your organization to specify with more control when a message should appear based on the URL address of specific pages.
From a new or existing step in a scenario, click Add Condition.
Use the Conditions dropdown menu to select Page URL Match.
In the Page URL Match panel, select whether you want to use the condition to include or exclude webpages that contain certain words in the URL. The selection will have a white background
Input the word, phrase, etc. that will be included or excluded as part of the targeting condition and where in the URL the word, phrase, etc... can be found.
Note: Please remember to enter the page names using a regex format, in this example .*privacy-policy.* and .*data-compliance.*. More information on this can be found here.
Additionally, be aware that query string parameters are not supported in the page URL match condition (e.g. ?showPM=true
).
Delimit multiple values in a single condition with a comma. These values utilize OR logic so that if one of the values input into the field is found then the condition will be satisfied.
When multiple page URL match conditions are added to a scenario step, each condition utilizes AND logic. That is, like other conditions you have configured for the scenario step, each page URL match condition must be satisfied for the step to trigger.
To add multiple page URL match conditions to a scenario step, click + to the right of each condition statement.
Click Add when finished.
Examples - page URL targeting with regex
A regular expression (shortened as regex) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation.
We provide two examples how regex can be used with the Page URL Match gate.
Display a message for domain
Your organization wants to display messages for the main domain, subdomains and subdirectories belonging to mydomain.com.
To display the message the Page URL Match should be set to 'Include' and the match condition set to 'contains'. The regex argument should be set to .*mydomain.com.*.
Exclude a message for specific page
Your organization can exclude messages for a specific page, for example a privacy policy page at https://finance.mydomain.com/privacy-policy where your organization does not need the message to be shown.
To prevent the message being shown the Page URL Match should be set to 'Exclude' and the match condition set to 'Ends with'. The regex argument should be set to .*privacy-policy.*.
Comments
0 comments