add tracking code and stuff to station widget #187

Closed
brianboyer opened this Issue Jan 17, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

brianboyer commented Jan 17, 2013

from aly:

so here's an example (look at the 2nd widget):

http://www.npr.org/promos/election2012/elex2012.promo.test.html

we give stations a bit of code that includes a bit of js

that js has all the tracking code, and does a document.write to iframe in the widget:

http://www.npr.org/promos/election2012/elex2012.promo.js

(this is probably not the most elegant way to do it. it predates me.)

there are 2 things you need to change in the js:

the ref to the iframe, and this line:

'<script type="text/javascript">window.vsitag = {"imp":"npr_election_2012_widget"};</script>',

change npr_election_2012_widget to something more appropriate

whatever you want it to be

@onyxfish onyxfish added a commit that referenced this issue Jan 18, 2013

@onyxfish onyxfish Add widget tracking js. #187. bce8070
Contributor

onyxfish commented Jan 18, 2013

Done, with three open questions:

  1. Are we going to allow member stations to disable the audio player like we did with election night?
  2. The tracking code in this snippet ends in -3, but our usual one ends in -12. I assume this is the npr.org one. Do we want it that way?
  3. Does this have to be hosted on www.npr.org, or can we just deploy it with our usual rig and give them an apps.npr.org url?
Contributor

brianboyer commented Jan 18, 2013

  1. I have received no requests for this, so, no.
  2. No idea.
  3. No idea.
Owner

alykat commented Jan 18, 2013

  1. Inaug widget doesn't have that feature -- everything points to the app this time. Can remove the audio bit from the station embed code.

  2. You could check with Jeff Nemic, but I'd just leave it. I suspect it's a separate Member and Program Services analytics acct.

  3. Double check that the .js file isn't dependent on anything on www. I suspect it would be fine living on apps.

Contributor

onyxfish commented Jan 18, 2013

Here is the code to embed the widget:

<script type="text/javascript">
    nprInaugurationWidth = 960;
    nprInaugurationHeight = 230;
</script>
<script type="text/javascript" src="http://apps.npr.org/inauguration/js/widget.js"></script>

Default size is 300x500 if not provided.

Contributor

onyxfish commented Jan 18, 2013

@alykat Awesome. The only www dependency is this bit of javascript:

http://www.npr.org/include/javascript/zigi.js

But it should be fine to just pull that cross-domain. (It's working now.)

Closing this now.

onyxfish closed this Jan 18, 2013

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