Skip to content

Instantly share code, notes, and snippets.

@montchr
Last active February 8, 2022 18:59
Show Gist options
  • Save montchr/d996eee4348687a5df52de8d23166536 to your computer and use it in GitHub Desktop.
Save montchr/d996eee4348687a5df52de8d23166536 to your computer and use it in GitHub Desktop.
BlueConic Bookmarklets

BlueConic Bookmarklets

Installation

Firefox

  1. Right-click the bookmarks bar
  2. In the URL field, paste the "Content" snippet
  3. Name the bookmark whatever you like

Chrome

Who knows…

Usage

  1. Copy the key of the profile property you'd like to query
  2. Go to a site where a BlueConic script is loaded
  3. Click the bookmarklet and enter the profile property key in the ensuing prompt
  4. Submit the prompt and observe the result of your query

User Profile Property Query

Content

javascript:(function()%7Bconst%20bcProperty%20%3D%20window.prompt('Enter%20the%20BlueConic%20profile%20property%20key%20to%20check')%3Basync%20function%20getBcPropertyValue(key)%20%7Bawait%20window.blueConicClient.profile.getProfile().loadValues(%5Bkey%5D)%3Bconst%20value%20%3D%20window.blueConicClient.profile.getProfile().getValue(key)%3Bwindow.alert(%60%5B%24%7Bkey%7D%5D%3A%20%24%7Bvalue%7D%60)%3B%7DgetBcPropertyValue(bcProperty)%7D)()

Source

const bcProperty = window.prompt('Enter the BlueConic profile property key to query');
async function getBcPropertyValue(key) {
  await window.blueConicClient.profile.getProfile().loadValues([key]);
  const value = window.blueConicClient.profile.getProfile().getValue(key);
  window.alert(`[${key}]: ${value}`);
}
getBcPropertyValue(bcProperty);

License

Copyright (c) 2022 Chris Montgomery chris@cdom.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment