Ok so once thing to understand is that when Adobe first introduced Adobe Analytics or SiteCatalyst as it used to be known there were no tag management system or event common utility functions across Adobe products. In order to palliate this issue, Adobe Consulting created several utility plugins that relied on method used in core Adobe analytics library to write and read cookies for example. That is why in most instances the plugins were scoped to s object.
Having said that, it is a misconception that you need to use Adobe plugins to do what you need. You can write it yourself or you can also use Adobe Launch functionalities to do the same.
The default data element functionalities should allow you to do same outcome as some of the plugins:
For the plugin getQueryParam you can simply use this data element type:
Query string parameter
Specify a single URL parameter in the URL Parameter field.
Only the name section is necessary and any special designators like “?” or “=” should be omitted
Now for getValOnce you can use the latest version of plugin. I checked it and there is one reference to c_r from Adobe Analytics that creates an issue but replacing it by cookieRead function fixes it just fine. Will report the issue to Adobe for a fix.
So in code you will see:
return e&&(k=k||"s_gvo",l=l||0,m="m"===m?6E4:864E5,e!==this.c_r(k))?(c=new Date,c.setTime(c.getTime()+l*m),cookieWrite(k,e,0===l?0:m),e):""};
replace this by
return e&&(k=k||"s_gvo",l=l||0,m="m"===m?6E4:864E5,e!==cookieRead(k))?(c=new Date,c.setTime(c.getTime()+l*m),cookieWrite(k,e,0===l?0:m),e):""};
And that should work without Adobe Analytics core library, I tested on a site without Adobe Launch and analytics and it works just fine.
What I want to highlight is that plugins should not be scoped to one of your adobe or third party product. It should be written in a way that it is usable by all.
So to use this solution what I would do it as follow:
- Create one data element to return query params
- Create a data element with Extension Core and Data Element type Query String Parameter
- Now for URL Query String parameter field add cin
- Create a data element which will deploy modified plugin code and return the value
- Create a data element with Extension Core and Data Element type Custom Code
- Paste the modified plugin code.
- After the plugin code add line return getValOnce(event.value, event.name, event.duration)
- Either create another data element to return your campaign value or use it directly in custom code as follow:
//we consider that campaign query param data element is name paramCid
//we consider that custom getValOnce is named getOnce
_satellite.getVar('getOnce', {value: _satellite.getVar('paramCid'), name: "test", duration: 30})
//On first run it should return query param if exist
//On second run with same query param value in next 30 days it should not return anythingHere you have a solution that does not depend on adobe analytics AppMeasurement and you can reuse getOnce data element to get value once for other values. Hope this helps
Warning:
I have noticed that getValOnce will return the value each time if the value is a number. The current plugin does exact evaluation to value and type needs to be the same and as cookie always return a string when it does let say 123 !== '123' it returns false... so 123 will always be returned.