Track a Universal RentPath Identity
Copy and paste the following snippets into your Web site so that each page view executes the code. For example, you might embed the code in a header, footer, or some other element that is rendered within every page of your site.
script tag above loads the RentPath Identity library from a CDN.
Please replace the x.y.z in the
src with the version number of the
latest release of the library. To find the latest release, run the command...
$ npm view identity-rentpath versions
script tag above creates an RUID (if one has not already been saved as
a cookie) and sends tracking information, including the RUID, your hostname, and
the complete URL of the current page, to our servers.
To test operation, open your application (perhaps after a server restart or
section of your browser’s development tools. If you see a new cookie named
uzid, tracking is operational.
Packaging via npm
Install RUID with the command:
$ npm install identity-rentpath --save-dev
For Developers with Existing Google Tag Manager Tags
To begin, open your GTM console and create the tag to load the library.
Click New Tag.
On the next screen, click at top and name the tag Load RUID Library.
When asked to choose a type for the tag, select Custom HTML Tag.
Copy and paste the following code into the configuration text box:
Replace the x.y.z with the version number of the latest release of the library. You can use npm view to list all available versions (see the command to use in the first section) or browse the releases on this repository’s Github releases page.
Choose the trigger to Fire on All Pages.
Save the tag.
Next, create the tag to create and track the RUID.
Click New Tag.
Name this tag Track RUID.
Choose Custom HTML Tag again.
Copy and paste this piece of code:
Again, choose a trigger to Fire on All Pages.
Save the tag.
Finally, open a container that is present on each page of your site, add both the Load RUID Library and Track RUID tags you just created, and publish the new version of the container.
Once published, the tracking code should work immediately.
For RUID Library Developers
The RentPath Universal Identity is implemented as an ES6 library.
$ git clone email@example.com:rentpath/identity.js.git $ npm install $ npm start # # Open http://localhost:5000 in a browser. # Chrome typically works best for debugging. # The default page shown is src/index.js. ...
Before you commit any new code, scan your JS with ESLint.
$ npm run lint
Automated tests poke and prod the entry points to the library. Karma is the test runner. The default test runner executes the tests only once, which is ideal for CI (Travis and such).
$ npm run test
The next command automatically monitors all files for changes and reruns the tests. This command is ideal for active development.
$ npm run test_watch
$ webpack --debug --devtool sourcemap --output-pathinfo --config webpack.config.js $ webpack --config webpack.config.production.js
The first use of webpack generates files ./dist/identity-version.js and
./dist/identity-version.js.map, where version is a
1.1.0 defined by semantic versioning. The second command
produces ./dist/identity-version.min.js and ./dist/identity-version.min.js.map.
Releasing New Code
If the master branch passes all tests, it is packaged in three forms and sent to npm, Github, and S3, respectively.