π Definition
If you want to include or exclude a specific operating system (OS) or a specific device from a campaign segment, you can add custom code snippets directly in the targeting step.
βοΈConfiguration
To do so, apply the following steps:
- In the trigger section (How) of the targeting step, click New trigger.
- From the criteria list, select the Code criteria and copy/paste snippets below according to your needs.
- Select the At regular intervals option in the Targeting verification section.
Code snippets
βοΈ Include |
β Exclude |
||
Device |
Iphone |
return navigator.userAgent.indexOf('iPhone') > -1; |
return navigator.userAgent.indexOf('iPhone') < 0; |
Ipad |
return navigator.userAgent.indexOf('iPad') > -1; |
return navigator.userAgent.indexOf('iPad') < 0; |
|
OS |
IOS |
return navigator.userAgent.indexOf('iPhone') > -1 || navigator.userAgent.indexOf('iPad') > -1; |
return navigator.userAgent.indexOf('iPhone') < 0 && navigator.userAgent.indexOf('iPad') < 0; |
Android |
return navigator.userAgent.indexOf('Android') > -1; |
return navigator.userAgent.indexOf('Android') < 0; |
Comments
0 comments
Please sign in to leave a comment.