How to validate custom variables set by RTP API

Level 1

How to validate custom variables set by RTP API


We are trying to set custom variables through RTP API to detect the user type and show campaign on the website accordingly. Following is the code snippet we are using:

<script type='text/javascript'>
c[a].a=i;c[a].e=e;var g=h.createElement("script");g.async=true;g.type="text/javascript";
g.src=f+'?aid='+i;var b=h.getElementsByTagName("script")[0];b.parentNode.insertBefore(g,b);

// Set custom variable
rtp('set', 'customVar1', 'rtp_user');

rtp('get', 'campaign', true);

// Set custom variable
rtp('set', 'customVar2', 'rtp_user2');


Also User Context API filter has been set on the segment


However, as soon as we set these filters, campaign is not visible on the page and after removing these filters it appears on the page.


Is there a way to verify if these custom variables are set properly?


Thanks in advance for your time.