You're thinking of pheromone traps.
I think those are sticky traps without any scent. They act on color alone, yellow which is attractive to insects.
If the bugs are in your tree, they won't see the traps outside it, but might just see one that's inside.
If an insect is outside the tree and would normally bypass it anyway, it won't see the trap that's inside your tree, but will see ones near the tree, throwing off the actual numbers that would actually be attracted by your tree species.