Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:08:17+00:00 2026-06-14T17:08:17+00:00

Impression trackers are commonly URLs that you can hit by using the new Image().src

  • 0

Impression trackers are commonly URLs that you can hit by using the new Image().src method or something similar. I’ve only ever seen pixels or PHP scripts get hit in these URLs.

What happens when a third party wants a JavaScript code snippet to execute? Like the following

<script src="http://their.special/javascript.file.js"></script>
<script>
    aFunctionThatExistsInThatSpecialFile();
    if(someFlagSetInThatFile) {
        someObjectInThatFile.setSomeProperty();
    }
    someOtherFunction();
</script>

Or it could look like

var myVar = document.getElementById('someID');
//... more JavaScript

The snippet could do whatever it wants like write out a cookie or something.

You can’t load this as the source of an img. You shouldn’t do a document.write because the impression event could fire after page load. A document.write could wipe the whole page.

So how do you use JavaScript to support this kind of impression tracker?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:08:18+00:00Added an answer on June 14, 2026 at 5:08 pm

    If you look at something like AdWords, you’d usually see something like:

    <script src="//google.com/something/something.js"></script>
    <script>
        account_name = "name";
        dollar_value = 37.05;
        fire_adWords_tracking();
    </script>
    

    That isn’t really what it looks like at all.
    But it is what it does — basically.

    These days, however, more programs are doing things like (consider GA):

    var tracker = tracker || []; // if tracker doesn't exist, make it an array
    tracker.push(["account", "12345H"],
                 ["amount", "37.05"],
                 ["product_name", "thingy"]);
    

    And then at the bottom of the page, loading a script which will look for tracker and make an image to track all of the data:

    (function () {
        var s = document.createElement("script"),
            parent = document.getElementsById("script")[0].parentNode,
            src = "//google.com/wherever.js";
        s.src = src;
        parent.appendChild(s);
    }());
    

    Whenever it loads, it will go through the array of stuff that was handed to it, and put it together one by one.

    If you’re talking about firing it on “Impression”, then you (or your company’s stakeholders — marketing or IT, or a higher-up in Analytics) will have to define what “Impression” means to them.

    For a lot of people, just having it on the bottom of the page, so that it fires when the page loads (ie: an “impression” of the page), is sufficient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was under the impression that using the Resolve method returned a new instance
I was under the impression that Compass could generate sprites from image files in
My impression is that, when I hit Stack Overflow for the first time, it
I was under the impression that any function in C would support only one
I had been under the impression that in a C++/CLI method if a class
I was under the impression that these days javascript can be used as a
I was under the impression that webm played on Android, but I can't get
I was under the impression that obj.method caused ruby to look for method thusly:
I'm under the impression that changing an anchor tag on hover can be done
I was under the impression that since I'm using the current version of jQuery,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.