Jump to content
vtoshach

Help With Adding Random Session Id

Recommended Posts

Hi 
 
I need help with my JS code. I need to be able to pass a random session ID to the URL link for a banner. The site sets it when users login.  I need my code to remember it when a user clicks on the banner.  The hidden value on the page is name="SESSIONTAB".  I would like to add it to the invocation JS code.  

Share this post


Link to post
Share on other sites

So, just so I understand - you want the URL that users will be directed to, which will be off your site, to include a parameter that is not known to Revive Adserver?

 

i.e.:

 

User logs into your site and gets a session ID.

User clicks on a banner.

User is sent to remote site using URL www.example.com?session=ID

 

Is that right?

 

If so, I think the only way to do that is to have your site modify the JS invocation code before that code is output to the user's browser. I don't think there is any way to do this natively with Revive Adserver.

Share this post


Link to post
Share on other sites
Solved.
 
In case anyone else needs this:  I needed to append the URL with a session id.  Mine is actually called Sessiontab.  Where the zone is defined in the JS code, I added this to it:
    &sessiontab=" + document.querySelector('[name=SESSIONTAB]').value);
 
So this is what it would look like:
 
    document.write ("?zoneid=6&sessiontab=" + document.querySelector('[name=SESSIONTAB]').value);
 
 
On the adserver where I enter the information for the banner, I needed to add a variable to the URL.  It looks like this:
 
    &sessiontab={sessiontab}
 
I used ampersand, because I already used a ? in the string.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...